1.JDK1.6下载URL:

http://www.oracle.com/technetwork/java/javase/downloads/java-archive-downloads-javase6-419409.html#jdk-6u20-oth-JPR

下载:jdk-6u20-linux-x64.bin

2.通过winSCP把文件jdk-6u20-linux-x64.binWindows系统传输到Linux系统(centos6.4_64)的/usr/local/目录下。

3.使用root用户登录到centos6.4_64位系统。

4.cd /usr/local

5.chmod a+xjdk-6u20-linux-x64.bin

6.rpm –qa|grep jdk

    rpm -e --nodepsjava-1.6.0-openjdk-1.6.0.0-1.61.1.11.11.el6_4.x86_64

rpm -e --nodeps java-1.7.0-openjdk-1.7.0.19-2.3.9.1.el6_4.x86_64

rpm -e --nodeps tzdata-java-2013c-1.el6.noarch

rpm -e --nodeps tzdata-2013c-1.el6.noarch

rpm -e --nodeps libgcj-4.4.7-3.el6.x86_64

rpm -e --nodeps java-1.5.0-gcj-1.5.0.0-29.1.el6.x86_64

7../ jdk-6u20-linux-x64.bin

8.vim /etc/profile:

exportJAVA_HOME=/usr/local/jdk1.6.0_20

exportCLASSPATH=.:$JAVA_HOME/jre/lib:$JAVA_HOME/lib/tools.jar:$JAVA_HOME/lib/rt

.jar:$JAVA_HOME/lib/dt.jar

exportJRE_HOME=$JAVA_HOME/jre

export PATH=$PATH:$JAVA_HOME/bin:$JRE/bin

9.source /etc/profile

10.Java –version

出现:java -version

javaversion "1.6.0_20"

Java(TM)SE Runtime Environment (build 1.6.0_20-b02)

Java HotSpot(TM) 64-Bit Server VM (build 16.3-b01, mixedmode)