First, check the installation path of the JDK:
Whereis Java
Which Java (Java execution path)
Echo $JAVA _home
Echo $PATH
Second, uninstall the old version of the JDK:
1. Determine the version of the JDK:
Rpm-qa | grep JDK
Rpm-qa | grep GCJ
The possible results are:
Libgcj-4.1.2-42.el5
java-1.4.2-gcj-compat-1.4.2.0-40jpp.115
2. then uninstall :
Yum-y Remove java-1.4.2-gcj-compat-1.4.2.0-40jpp.115
If this method does not work, you can uninstall it using the following method:
1 Uninstall the JDK version that comes with your system:
To view your own JDK:
#rpm-qa|grep GCJ
You may see a message similar to the following:
Libgcj-4.1.2-44.el5
java-1.4.2-gcj-compat-1.4.2.0-40jpp.115
Use the RPM-E--nodeps command to delete what you found above:
#rpm-e–nodeps java-1.4.2-gcj-compat-1.4.2.0-40jpp.115
2 ) Uninstall JKD version of RPM installation
To view the installed JDK:
#rpm-qa|grep JDK
You may see a message similar to the following:
Jdk-1.6.0_22-fcs
Unloading:
#rpm-E--nodeps Jdk-1.6.0_22-fcs
3) Locate the _uninst subdirectory of the JDK installation directory
• Execute commands at the shell terminal./uninstall.sh to uninstall the JDK
Uninstall JDK under Linux