-
June 5th, 2012, 03:57 PM
#1
Sign a jar file in JDK 6.0_U32
Hello,
I am trying to sign a jar file in JDK 6 update 32 and i am getting below error:
Exception in thread "main" java.lang.NoClassDefFoundError: sun/security/tools/Ja
rSigner
Caused by: java.lang.ClassNotFoundException: sun.security.tools.JarSigner
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
Could not find the main class: sun.security.tools.JarSigner. Program will exit.
I could not figure out which jar file to include in the classpath. Can someone suggest the correct way of doing it?
Regards,
Suresh
-
June 5th, 2012, 04:26 PM
#2
Re: Sign a jar file in JDK 6.0_U32
It depends on what you are trying to do but a simple way of signing a jar using a key store is
Code:
jarsigner -keystore myKeystore MyJar.jar myAlias
-
June 6th, 2012, 08:01 AM
#3
Re: Sign a jar file in JDK 6.0_U32
Yes, i am doing as you said. But why i am getting class not found exception? Which jar in should include in my classpath? I tried to look for sun/security/tools/JarSigner class under every jar i can think of within JDK but don't find it anywhere.
Regards,
Suresh
-
June 6th, 2012, 11:38 AM
#4
Re: Sign a jar file in JDK 6.0_U32
$ unzip -l tools.jar | grep -i "jarsigner.class"
31124 09/10/09 01:47 sun/security/tools/JarSigner.class
Try tools.jar in $JAVA_HOME/lib using JDK_1_5_22. I'm not sure using Java 6.
Regards,
Albert.
Please, correct me. I'm just learning.... and sorry for my english :-)
-
June 6th, 2012, 02:44 PM
#5
Re: Sign a jar file in JDK 6.0_U32
Originally Posted by AlbertGM
Try tools.jar in $JAVA_HOME/lib using JDK_1_5_22. I'm not sure using Java 6.
Yep, it's in the same place in Java 6.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|