卸載jdkjava
[root@n6 ~]# rpm -qa|grep jdk //查詢已安裝的jdk
java-1.7.0-openjdk-1.7.0.79-2.5.5.3.el6_6.x86_64
[root@n6 ~]# #rpm -e --nodeps ava-1.7.0-openjdk-1.7.0.79-2.5.5.3.el6_6.x86_64 //卸載已安裝的jdknode
[root@n6 soft]# chmod u+x jdk-6u45-linux-x64.bin //給jdk安裝文件執行權限linux
[root@n6 soft]# ./jdk-6u45-linux-x64.bin //安裝jdk 測試
[root@n6 jdk1.6.0_45]# vi /etc/profile //配置jdk環境變量ui
export JAVA_HOME=/opt/soft/jdk1.6.0_45
export CLASSPATH=$JAVA_HOME/lib
export PATH=$JAVA_HOME/bin:$PATHit
[root@n6 jdk1.6.0_45]# source /etc/profile //使配置文件當即生效io
[root@n6 jdk1.6.0_45]# java -version //測試成功
java version "1.6.0_45"
Java(TM) SE Runtime Environment (build 1.6.0_45-b06)
Java HotSpot(TM) 64-Bit Server VM (build 20.45-b01, mixed mode)變量