jarsigner “Only one alias can be specified”

本小妞迷上赌 提交于 2019-12-18 05:45:09

问题


In Windows command prompt:

>keytool -genkey -alias me
>keytool -selfcert -alias me
>jarsigner myJar.jar me
Only one alias can be specified

I have failed to find any info on this error on the web. I'm obviously only specifying one alias here. What could I be doing wrong?


回答1:


I was getting the same error.

I resolved it by renaming the folders in my path

c:\this is a folder\ replaced with c:\this_is_a_folder\

jarsigner doesn't like spaces in folders




回答2:


Just put quotes around the filename(s) with spaces. You need to quote arguments with spaces in them, to any program. Nothing to do with jarsigner whatsoever.




回答3:


Remove the space from Folder Name like

jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore my-release-key.jks D:\AndroidProject\CheckFinalCodeNew\CheckFinalCode\platforms\android\build\outputs\apk\android-release-unsigned.apk my-alias

The problem would be resolve




回答4:


I had the same problem and solved it by switching to jarsigner from jdk 6. Although I created my cert with keytool from jdk 7, I could not sign it with its jarsigner.



来源:https://stackoverflow.com/questions/8748089/jarsigner-only-one-alias-can-be-specified

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!