2012-01-25 95 views
1

我想签署一个JAR文件。我产生了新的商店使用.keystore意外删除

"keytool -genkey -alias myStore -keystore mainstore" 

并与我的Windows用户目录下的实际名称为“mainstore”得到了所产生的商店。

我再尝试自我签署使用

"jarsigner myApp.jar myStore". 

JAR文件但我发现了错误:

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

我看着和的.keystore文件不存在。我认为它被误删了。有没有办法生成一个新的.keystore文件?

在此先感谢。

回答

3

由于manual page for jarsigner状态:

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.

这意味着在Windows中,C:\Users\myusername\.keystore是默认密钥库文件。

那么你可能需要做的是告诉jarsigner您的密钥库位于:

jarsigner -keystore mainstore myApp.jar myStore 
0

您的文件会被删除,我有同样的问题,并更新到最新的JDK解决我的问题。