问题
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