.keystore deleted by accident

南笙酒味 提交于 2019-12-11 05:27:23

问题


I'm trying to sign a JAR file. I generated a new store using the

"keytool -genkey -alias myStore -keystore mainstore"

And the store got generated with the actual name "mainstore" under my Windows user directory.

I then try to self sign the JAR file using

"jarsigner myApp.jar myStore".

But I'm getting error:

jarsigner error: java.lang.RuntimeException: keystore load: C:\Users\myusername    \.keystore (The system cannot find the file specified)

I looked and the .keystore file is not there. I think it got deleted by accident. Is there a way to generate a new .keystore file?

Thanks in advance.


回答1:


As the manual page for jarsigner states:

jarsigner has a -keystore option for specifying the name and location of the keystore to be used. The keystore is by default stored in a file named .keystore in the user's home directory, as determined by the user.home system property.

Which means that in Windows, C:\Users\myusername\.keystore is the default keystore file.

So what you probably need to do is tell jarsigner where your keystore is located:

jarsigner -keystore mainstore myApp.jar myStore



回答2:


Your file might not be deleted, I was having the same problem and updating to the latest jdk solved my problem.



来源:https://stackoverflow.com/questions/9006659/keystore-deleted-by-accident

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!