问题
I've created a small Android application using Ionic and I was going to build the signed apk to test the app.
When I typed 'keytool' command in my command prompt I'm getting this error
'keytool' is not recognized as an internal or external command, operable program or batch file.
And I tried googling and all solved problems mentions that it's a problem with Path variable of JDK. I tried changing my 'JAVA_HOME' variable value to 'C:\Program Files\Java\jdk1.8.0_131\bin' and to 'C:\Program Files\Java\jre1.8.0_131\bin' and still getting the same error.
But when I run the 'keytool' command it the cmd 'C:\Program Files\Java\jre1.8.0_131\bin' location, it works.
Can anyone help me with this ? What might be a problem that I can't access it globally ?
回答1:
That happens because you haven't added the bin directory of your JAVA_HOME
environment variable in your %PATH%
.
- Add the environment variable
JAVA_HOME
with path C:\Program Files\Java\jdk1.8.0_131 without the bin directory. - Add the
%JAVA_HOME%\bin
directory at the end of your%PATH%
.
来源:https://stackoverflow.com/questions/43720147/keytool-is-not-recognized-as-an-internal-or-external-command