gpt4 book ai didi

java - .keystore 被意外删除

转载 作者:行者123 更新时间:2023-11-29 06:04:27 26 4
gpt4 key购买 nike

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

生成了一个新商店
"keytool -genkey -alias myStore -keystore mainstore"

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

然后我尝试使用

自签名 JAR 文件
"jarsigner myApp.jar myStore".

但是我得到了错误:

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

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

提前致谢。

最佳答案

作为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 是默认的 keystore 文件。

所以您可能需要做的是告诉 jarsigner 您的 keystore 位于何处:

jarsigner -keystore mainstore myApp.jar myStore

关于java - .keystore 被意外删除,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9006659/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com