简体   繁体   中英

Android facebook hash key error - 'c:\Program' is not recognized as an internal or external command,

I can't generate the key. I get an error

'c:\\Program' is not recognized as an internal or external command,

I have this command

c:\Program Files\Java\jdk1.7.0_05\bin\keytool.exe -exportcert -alias androidfacebook -keystore C:\Users\Jo\Desktop\facebookkey.keystore | c:\OpenSSL-Win32\bin\openssl.exe sha1 -binary | openssl enc -a -e

If you want your existing command to work, you can most likely replace the "Program Files" portion with Progra~1, to get the underlying short directory name, without spaces. Assuming the remainder of the command is correct.

Although this is tagged Java and Android, I'm assuming from the command you are executing and the error message that this command is executing on your Windows development machine.

The command line interpretor is regarding the space between Program and Files as a delimiter. Wrapping the path in quotes is the normal way to deal with this problem:

"c:\Program Files\Java\jdk1.7.0_05\bin\keytool.exe" -exportcert ......

Pass your command in double quotes("")

 "c:\Program Files\Java\jdk1.7.0_05\bin\keytool.exe" -exportcert -alias androidfacebook -keystore C:\Users\Jo\Desktop\facebookkey.keystore | c:\OpenSSL-Win32\bin\openssl.exe sha1 -binary | openssl enc -a -e

it will work.

lets make it easy set your java path as given here

then try only this

keytool.exe -exportcert -alias androidfacebook -keystore C:\Users\Jo\Desktop\facebookkey.keystore | c:\OpenSSL-Win32\bin\openssl.exe sha1 -binary | openssl enc -a -e

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM