Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Default keystore file does not exist?

I'm getting this error.

C:\Program Files\Java\jre7\bin>keytool -list -v -keystore "C:\Users\Suresh\.android\debug.keystore" -alias androiddebugkey -storepass android -keypass android  keytool error: java.lang.Exception: Keystore file does not exist: C:\Users\Suresh\.android\debug.keystore  java.lang.Exception: Keystore file does not exist: C:\Users\Suresh\.android\debug.keystore  at sun.security.tools.KeyTool.doCommands(Unknown Source) at sun.security.tools.KeyTool.run(Unknown Source) at sun.security.tools.KeyTool.main(Unknown Source)  C:\Program Files\Java\jre7\bin> 

enter image description here

like image 282
Jahir Avatar asked Mar 10 '13 05:03

Jahir


People also ask

Where is the default keystore?

By default, Java has a keystore file located at JAVA_HOME/jre/lib/security/cacerts. We can access this keystore using the default keystore password changeit.

What is the default keystore type?

In earlier versions of JDK, the Java Keytool default to create a keystore of type JKS. From JDK version 9 and higher, the default keystore type is PKCS12. Explanation: From version JDK9 and higher, the default keystore type generated when using Keytool is set to PKCS12.

How do I change my default keystore?

You can change the default keystore password as follows: Change the keystore password in the keystore using the following command: $ keytool -storepasswd -keystore /path/to/security/keystore. jceks -storetype JCEKS -storepass 'changeit' -new 'newPassword'


1 Answers

You must be providing the wrong path to the debug.keystore file.

Follow these steps to get the correct path and complete your command:

  1. In eclipse, click the Window menu -> Preferences -> Expand Android -> Build
  2. In the right panel, look for: Default debug keystore:
  3. Select the entire box next to the label specified in Step 2

And finally, use the path you just copied from Step 3 to construct your command:

For example, in my case, it would be:

C:\Program Files\Java\jre7\bin>keytool -list -v -keystore "C:\Users\Siddharth Lele.android\debug.keystore" -alias androiddebugkey -storepass android -keypass android

UPDATED:

If you had already followed the steps mentioned above, the only other solution is to delete the debug.keystore and let Eclipse recreate it for you.

Step 1: Go to the path where your keystore is stored. In your case, C:\Users\Suresh\.android\debug.keystore

Step 2: Close and restart Eclipse.

Step 3 (Optional): You may need to clean your project before the debug.keystore is created again.

Source: http://www.coderanch.com/t/440920/Security/KeyTool-genkeypair-exception-Keystore-file

You can refer to this for the part about deleting your debug.keystore file: "Debug certificate expired" error in Eclipse Android plugins

like image 123
Siddharth Lele Avatar answered Oct 01 '22 07:10

Siddharth Lele