我正在尝试使用 java 1.7 使用 JarSigner API 对 jar 进行签名。这适用于 Linux 和 Windows 计算机,但在 AIX 计算机中失败,并出现 classnotfound 异常(对于类“sun.security.tools.KeyTool”)。
我也无法找到类“com.ibm.crypto.tools.KeyTool”的 jar,IBM 称这是替代方案。
最佳答案
在 IBM/Java6 中,有一个 $JRE_HOME/lib/rt.jar(sun/security/tools/JarSigner.class)
和一个 $JRE_HOME/lib/ext/ibmjceprovider (com/ibm/crypto/tools/KeyTool.class)
在IBM/Java7中,有$JDK_HOME/lib/tools.jar(sun/security/tools/JarSigner.class)
和$JRE_HOME/lib/ext/ibmjceprovider(com/ibm/crypto/tools/KeyTool.class)
.
您可以将此“tools.jar”添加到CLASSPATH
中。
请注意,在 IBM/Java8 中,$JDK_HOME/lib/tools.jar
中没有 sun/security/tools/JarSigner.class
,但有 sun/security/tools/jarsigner/Main.class
。
关于java - 无法在 AIX 的 1.7 java 中找到 KeyTool 类,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54114312/