keytool is not recognized as a command when trying to obtain key
Solution 1
It looks like your %PATH%
- OS environment variable is not configured properly.
You can either:
Call keytool by specifying full path to your
<Java_Home>/bin/keytool.exe
executable file.
For me, the path looks like this:
"c:\Program Files (x86)\Java\jdk1.6.0_20\bin\keytool.exe"
Or,
Correct your
%Path%
variable; by appending%JAVA_HOME%\bin
to it.
Solution 2
"c:\Program Files(x86)\Java\jdk1.7.0\bin\keytool.exe" -list -v -alias androiddebugkey -keystore "C:\Users\EIS\.android\debug.keystore" -storepass android -keypass android
Then hit the "Enter" key and your MD5 and SHA1 will show.
Sam Bevins
Intern at the Air Force Research Lab (AFRL) in Dayton, Ohio.
Updated on June 04, 2022Comments
-
Sam Bevins almost 2 years
I am setting up a google maps activity and I am trying to get my API key. However in my cmd I get the error that keytool is not recognized as an internal or external command....ect.... I tried using the solution posted in a similar question but it didn't work for me.
My Default dubug keystore
C:\Users\Sam\.android\debug.keystore
-
Sam Bevins over 11 yearshow do i find mine then? I found what is above by going in to the properties in eclipse
-
Tomislav Novoselec over 11 yearslook in the folder where you've installed Java
-
Sam Bevins over 11 yearsI tried but it says now when I use CMD that The system cannot find the file specified
-
Sam Bevins over 11 yearskeytool -list -alias androiddebugkey \ -keystore <C:\Program Files\Java\jre7\bin>.keystore \ -storepass android -keypass android
-
Tomislav Novoselec over 11 yearsposition yourself in .android folder and execute this: "C:\Program Files\Java\jre7\bin\keytool.exe" -list -alias androiddebugkey -keystore debug.keystore -storepass android -keypass android -v
-
Sam Bevins over 11 yearsI used that in cmd because I'm not sure what you mean by positioning myself in the android folder. But when I ran it in cmd I got a java.lang.exception
-
Tomislav Novoselec over 11 yearsdo you even know how to navigate through your filesystem via cmd? "C:\Program Files\Java\jre7\bin\keytool.exe" -list -alias androiddebugkey -keystore "C:\Users\Sam\.android\debug.keystore" -storepass android -keypass android -v