Search code examples
javaaix

Not able to find KeyTool class in 1.7 java for AIX


I am trying to sign a jar using JarSigner API using java 1.7. This works in Linux and Windows machines but fails in AIX machines with classnotfound exception (for class "sun.security.tools.KeyTool").

I am also not able to find the jar for the class "com.ibm.crypto.tools.KeyTool" which IBM says is the alternative.


Solution

  • In IBM/Java6, there is a $JRE_HOME/lib/rt.jar(sun/security/tools/JarSigner.class) and a $JRE_HOME/lib/ext/ibmjceprovider(com/ibm/crypto/tools/KeyTool.class)

    In IBM/Java7, there is $JDK_HOME/lib/tools.jar(sun/security/tools/JarSigner.class) and $JRE_HOME/lib/ext/ibmjceprovider(com/ibm/crypto/tools/KeyTool.class).

    You can add this 'tools.jar' to the CLASSPATH.

    Mind you, in IBM/Java8 there is no sun/security/tools/JarSigner.class in $JDK_HOME/lib/tools.jar, but there is sun/security/tools/jarsigner/Main.class.