Tag Archives: keytool error

keytool error java.io.IOException:keystore was tampered with,or password was incorre

Keytool error: Java. IO. IOException: keystore was tampered with, or the password was incorrect

The inscription 2012-01-15

D:\> Keytool – import – trustcacerts – alias javacas – the file “D:/Tomcat 6.0/conf/myserver. Cert” – keypass 123456 – keystore “% JAVA_HOME %/jre/lib/security/cacerts”

The following error occurred when keytool generated the root certificate:
Keytool error: Java. IO. IOException: keystore was tampered with, or the password was incorrect

The reason is that the cacerts file will exist in the specified directory, backup it, remove it, and then execute the command Ok

keytool error: java.lang.Exception: Input not an X.509 certificate

This error occurs while using the KeyTool because the native is using the OpenJDK and the tool needs to use the JDK that comes with Oracle.
1. View the JDK on your current machine:

rpm -qa | grep jdk

The result of the native query is openJDK
2. Uninstall the currently installed OpenJDK using Yum Remove.
3. Download the JDK for Linux on oracle’s official website.
4. Configure the environment variable vim /etc/profile locally and then modify the following:

export JAVA_HOME=/home/test/jdk1.8.0_131 (You need to replace it with your own jdk path.)
PATH=$JAVA_HOME/bin:$PATH
CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
export JAVA_HOME  CLASSPATH  PATH

5. Reload /etc/profile:

source /etc/profile

6. Review the JDK on the current machine and configure it.
7, re-use the keytool command, successful.