The Linux system comes with the JDK (of course, if not, you can ignore this step), but still the old version of 1.4, so you need to uninstall first, and then install 1.6, uninstall the following steps:
[Email protected] ~]# Rpm-qa | grep JDK
[Email protected] ~]# Rpm-qa | grep GCJ
Libgcj-4.1.2-42.el5
java-1.4.2-gcj-compat-1.4.2.0-40jpp.115
First, confirm the specific version number of the JDK, and then
[Email protected] ~]# yum-y Remove java-1.4.2-gcj-compat-1.4.2.0-40jpp.115
1) Unzip the JDK installation package
./
Jdk-6u45-linux-x64.bin
If the permissions are insufficient:
chmod777 Jdk-6u45-linux-x64.bin
2) Vi/etc/profile last join
Java_home=/home/jdk1.6.0_45path= $JAVA _home/bin: $PATHset classpath=.: $JAVA _home/lib/dt.jar: $JAVA _home/lib/ Tools.jarexport Java_homeexport Pathexport CLASSPATH
3) Testing
command line Input java–version, if the current version is displayed, the JDK installation succeeds. (some environments require reboot)
Rapid installation of JDK under CentOS