skip to main | skip to sidebar

Monday, September 13, 2010

Ant Script To Sign A JAR File

To sign a JAR file you need a ‘keystore” first. You can create a sample keystore using the following simple command.
keytool -genkey -keystore <filename.store> -alias <aliasname>
After creating the keystore, you can add the following Ant tag to sign the JAR file using it.
<signjar jar="<JAR file to be signed>" alias="<Keystore Alias Name>" 
                keystore="<Keystorefile.store>" storepass="<Keystore password>"/>
Attributes used are
  • jar – The JAR file path which needs to be signed.
  • alias – Keystore alias name, given in the ‘keytool’ command to create the keystore.
  • keystore – Path to the keystore file, which was created using the ‘keytool’ command.
  • storepass – Keystore password used while creating the keystore using ‘keytool’ command.

2 comments:

Omkar Fatale said...

How can I sign my apps?
help me
I have made my own I want to sign my app?

Rakesh Reddy said...

Could you be more elaborate what do you mean by 'app' and where you are trying execute it!

Post a Comment