Cannot get the keystore for Android maps API


Ask by : Shazar November 04, 2012 11:09

I've recently tried to access the debug keystore created by the Eclipse SDK in order to use the Google maps API within my application. Now I know the file exists and have its path. However to access it and receive an MD5 fingerprint I have to use a keytool command.

Now I've been told that this command has to be done in the computers command prompt as there is no keytool GUI. And this is where the problem is as my command prompt doesn't recognise the command I'm giving it. Here's the command:

keytool -list-alias androiddebugkey-keystore(path_to debug_keystore).keystore-storepass android -keypass android

(Brackets should be left and right arrows) to which command prompt replies:

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

Now I tried manually entering the path which I believe would be (C: \Users\Adam.Android\debug.keystore).keystore I've also tried variations of C: \Adam.Android\debug.keystore).keystore Adam.Android\debug.keystore).keystore .Android\debug.keystore).keystore debug.keystore).keystore

Which it then replies: "the system cannot find the path specified"

So either command prompt doesn't recognise the command "keytool" or I'm entering the path wrong (which is likely as I don't use command prompt commands often enough to know how to write paths successfully).

I also run the C:\Program Files\Java\jre6\bin through my command prompt and it replies:

C: program\ is not reconized as internal or external command

Please help me out.

View original question

Answer by : kaderudNovember 04, 2012 11:09

You need to enclose commands/directories that contain spaces (or special characters), with the double qoute "

So to run your command, you would use:

C:\> "C:\Program Files\Java\jre6\bin\keytool" (option parameters)

So your complete command should look something like this then:

C:\> "C:\Program Files (x86)\java\jre6\bin\keytool.exe" -list -alias androiddebugkey -keystore C:\Users\Shazar\.android\debug.keystore -storepass android -keypass android

I've verified it on my system.

View original answer