.keystore意外删除 [英] .keystore deleted by accident

查看:1449
本文介绍了.keystore意外删除的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试签署一个JAR文件。我使用

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

"keytool -genkey -alias myStore -keystore mainstore"

并且在我的Windows用户目录下用实际名称mainstore生成了商店。

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

然后我尝试使用

"jarsigner myApp.jar myStore".

但我收到错误:

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

我看过,.keystore文件不存在。我认为它被意外删除。有没有办法生成新的.keystore文件?

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?

提前感谢。

推荐答案

由于 jarsigner 手册页$ c> 说明:

As the manual page for jarsigner states:


jarsigner $ c> -keystore 选项指定要使用的密钥库的名称和位置。密钥库默认存储在用户主目录中的 .keystore 文件中,由 user.home 系统属性。

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 是默认的密钥库文件。

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

所以你可能需要做的是告诉 jarsigner

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

jarsigner -keystore mainstore myApp.jar myStore

这篇关于.keystore意外删除的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆