记一次jar包签名的坑
记一次jar包的签名的坑
执行jar报错:
This operation repacks referenced libraries .Please review the licenses associated with libraries you wish to reference tomake sure you are able to repack them using this application . Note also thatis operation does not copy signature files from original libraries to thegenerated JAR file .
原因
.未对打打包后的jar进行签名
解决方法
.废话少说:
1.打包待签名的jar
2.进入jdk的bin目录
执行以下命令:
keytool -genkey -keystore admin.keystore -alias admin -validity 365
输入相关签名信息后…执行以下命令
jarsigner -keystore admin.keystore Client.jar admin
命令行解释
admin.keystore – 将密钥(key)和证书(certificates)存在一个称为keystore的文件中
-alias admin – 将admin.keystore定义了一个别名叫‘admin’
-validity 365 – 签名有效期365天
-jarsigner – 用 jarsigner 程序对jar包进行签名