ANT build:[signjar]输入密钥库的密码:

时间:2013-05-15 06:12:52

标签: eclipse ant keystore keytool jarsigner

我在eclipse中创建了一个项目,在尝试从命令提示符构建项目时,会询问以下内容:

[signjar] jarsigner error: java.lang.RuntimeException: keystore load: C:\Documents
and Settings\Gopakumar\.keystore (The system cannot find the file specified)


[signjar] Enter Passphrase for keystore:
BUILD FAILED
D:\Score\build.xml:556: The following error occurred while executing this line:
D:\Score\build.xml:147: jarsigner returned: 1

我已经在项目目录中使用keytool创建了密钥库文件,正是build.xml所在的位置。

但它没有提示密码短语?

1 个答案:

答案 0 :(得分:1)

试一试: 使用“keytool”命令创建StoreFile:

keytool -genkey -keystore YourKeyStoreFileAtPojectDirectory -storepass YourPassStoreString -keyalg rsa -alias YourKeyString -keypass YourPassKeyString -validity 99999  -storepass YourPassStoreString -dname "cn=XXYYZZ, o=XXYYZZ, l=YourCity, S=YourState, c=YourCountry"

并将signjar块放在build.xml中:

<signjar destDir="signed" 
  alias="YourKeyString" 
  keypass="YourPassKeyString"
  keystore="YourKeyStoreFileAtPojectDirectory"
  storepass="YourPassStoreString"
  digestalg="SHA1"
  sigalg="MD5withRSA"
>