ERROR:'keytool' is not recognized as an internal or external command, operable program or batch file

When I use the command:

C:\>keytool -list -alias androiddebugkey 
            -keystore .android\debug.keystore 
            -storepass android -keypass android

I get this error:

'keytool' is not recognized as an internal or external command, operable program or batch file.

I'm not able to get the certificate fingerprint(MD5) on my computer.

I have ensured that the keystore file is present in the appropriate location.

Any help?


Solution 1:

Check that the directory the keytool executable is in is on your %PATH% environment variable.

For example, on my Windows 7 machine, it is in C:\Program Files (x86)\Java\jre6\bin, and my %PATH% variable looks like C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\Program Files (x86)\Java\jre6\bin;C:\WINDOWS\System32\WindowsPowerShell\v1.0\ (and many other entries)

Solution 2:

This worked for me !! :

Go to this path or where ever you have your keytool.exe file

C:\Program Files\Java\jre7\bin

Hold shift and right click -> then press Open command window here

terminal will pop up, paste this in:

keytool -list -v -keystore "C:\Users\"Your-User-Name(no quotes)"\.android\debug.keystore" -alias androiddebugkey -storepass android -keypass android

gives you both MD5 and SHA1