• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Keytool.exe is not opening

 
Ahmed Jadoon
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am running Windows 10 64 bit on my PC. I have been trying to open "Keygen.exe" to sign an android app but it's not opening or just opens for a millisecond and then closes. I have tried opening it with Command prompt but same issue. I even tried to uninstall my JAVA 8 and installed java 7 and still same problem. Any solution to this?
 
Tim Moores
Bartender
Posts: 3127
50
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Keytool can't be run by double clicking it. What did you type in on the command line, and what exactly was the result?
 
Ahmed Jadoon
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Tim Moores wrote:Keytool can't be run by double clicking it. What did you type in on the command line, and what exactly was the result?
I moved to the directory where keytool.exe is in C:/Program files/Java/jre1.7.0_79/bin by cd command and then tried to open Keytool.exe by "start Keytool.exe" command and it didn't open at all and sometimes opened for a millisecond and close automatically.
 
Tapas Chand
Ranch Hand
Posts: 583
8
BSD Java
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Keytool will not be run by "start keytool.exe" command.

You have to run it by the command "keytool" itself.
e.g.,


for all options run the following command.
 
Ahmed Jadoon
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Tapas Chand wrote:Keytool will not be run by "start keytool.exe" command.

You have to run it by the command "keytool" itself.
e.g.,


for all options run the following command.
Thanks it worked and I went a step ahead this time but again stuck at the last step when keystore was about to be generated:
enerating 2,048 bit RSA key pair and self-signed certificate (SHA256withRSA) with a validity of 10,000 days
        for: CN=Ahmed Jadoon, OU=XXX, O=XXXX, L=Abbottabad, ST=KPK, C=PK
[Storing debug.keystore]
keytool error: java.io.FileNotFoundException: debug.keystore (Access is denied)
java.io.FileNotFoundException: debug.keystore (Access is denied)
        at java.io.FileOutputStream.open(Native Method)
        at java.io.FileOutputStream.<init>(FileOutputStream.java:221)
        at java.io.FileOutputStream.<init>(FileOutputStream.java:110)
        at sun.security.tools.KeyTool.doCommands(KeyTool.java:1152)
        at sun.security.tools.KeyTool.run(KeyTool.java:340)
        at sun.security.tools.KeyTool.main(KeyTool.java:333)
 
Tapas Chand
Ranch Hand
Posts: 583
8
BSD Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you post the exact command you are executing on command line?
 
Ahmed Jadoon
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Tapas Chand wrote:Can you post the exact command you are executing on command line?
.\keytool -genkey -v -keystore debug.keystore -storepass android -alias androiddebugkey -keypass android -keyalg RSA -keysize 2048 -validity 10000
 
Tapas Chand
Ranch Hand
Posts: 583
8
BSD Java
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Command seems OK.

I think program is not getting the access to write file in that location.

Are you running command prompt as Administrator?
 
Ahmed Jadoon
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Tapas Chand wrote:Command seems OK.

I think program is not getting the access to write file in that location.

Are you running command prompt as Administrator?
I ran as Administrator and I think it worked as it returned no error.

Now I don't know which directory it is stored.

 
Tapas Chand
Ranch Hand
Posts: 583
8
BSD Java
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ahmed Jadoon wrote:Now I don't know which directory it is stored.

That is why target path should be given while running the command.
In your case it might have been stored in the same path from where you were running the command.
 
Ahmed Jadoon
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Now I'm not able to create hash key for Facebook login for my Android app.
According to app documentations
Create a hash key for your certificate using the following command: keytool -exportcert -alias <RELEASE_KEY_ALIAS> -keystore <RELEASE_KEY_PATH> | openssl sha1 -binary | openssl base64
I don't know where I went wrong
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic