'keytool' is not recognized as an internal or external command
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%
.
Thidasa Pankaja
Passionate Software Engineer at Twire working towards achieving professional goals, with an active drive to learn new technologies. Skilled in JavaScript, React, Go, PostgreSQL etc. Strong engineering professional with a Bachelor of Science (Hons) focused in Information Technology from University of Moratuwa.
Updated on December 02, 2022Comments
-
Thidasa Pankaja over 1 year
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 ?
-
Stephen C almost 7 yearsThe problem is that the bin directory is not on your %PATH%. The command shell (e.g. "cmd.exe") looks for commands in the search path given by %PATH%.
-
Thidasa Pankaja almost 7 yearsThanks. But how to add the bin directory to %PATH% ?
-
-
Thidasa Pankaja almost 7 yearsThanks. As you've mentioned I changed JAVA_HOME variable path to 'C:\Program Files\Java\jdk1.8.0_131' But I don't get the 2nd point
-
Giorgio Antonioli almost 7 years@ThidasaParanavitharana You have also a variable named
Path
. You can find inside it, some paths to executable. At the end of these paths, you have to add the last path with%JAVA_HOME%\bin
-
Thidasa Pankaja almost 7 yearsThanks a lot. It worked
-
Giorgio Antonioli almost 7 years@ThidasaParanavitharana No problem. If it worked, mark the answer as accepted
-
Matias almost 6 yearsPerfect explanation. Just what I needed. Thanks a lot!