1. Uninstall system comes with JDK
Enter in the terminal
Yum-y remove Java java-1.4. 2-gcj-compat
2. Install new version of JDK
2.1 Environment variable Configuration
Vi/etc/profile
In
Export PATH USER LOGNAME MAIL HOSTNAME histsize INPUTRC
Add below
Export java_home=/usr/java/jdk1.6.0_31/
Expor Tclasspath=.:%java_home%/lib/dt.jar:%java_home%/lib/tools.jar
Export path= $PATH: $JAVA _home/bin
Save exit
Install new JDK
If the following error is reported
DL failure on line 685error:failed/usr/local/jdk1.6.0_10/jre/lib/i386/client/libjvm.so, because/usr/local/jdk1.6.0_ 10/jre/lib/i386/client/libjvm.so:cannot Restore segment prot after Reloc:permission denied
Later through the query, it is the problem of SELinux setup.
The solution is as follows:
1. Open/etc/selinux/config
2. Change Selinux=enforcing to Selinux=disabled
3. Restart Linux
Linux/centos uninstalling the System original jdk1.4 and installing a new JDK