1. Download jdk-7u65-linux-x64.tar.gz
2. View the original jdk installation information
[root@localhost ~]# rpm -qa | grep java
tzdata-java-2012c-1.el6.noarch
java-1.7.0-openjdk-1.7.0.45-1.45.1.11.1.el6 .x86_64
3. Uninstall OpenJDK
[root@localhost ~]# rpm -e --nodeps tzdata-java-2012c-1.el6.noarch
[root@localhost ~]# rpm -e --nodeps java-1.7.0-openjdk -1.7.0.45-1.45.1.11.1.el6.x86_64
Install JDK1.7
4.#Unzip the file
[root@localhost Software]# tar -zxvf jdk-7u65-linux-x64.tar.gz -C /usr/local/java/
#Configure environment variables, switch to /etc/ folder
[root@localhost Software]#cd /etc
#Open profile file
[root@localhost etc]# vi profile
#Add the following to the last line of the profile
#set java environment
export JAVA_HOME=/usr/local/java/java7
export CLASSPATH=.:$JAVA_HOME/lib
export PATH=$PATH:$JAVA_HOME/bin
#Refresh the configuration file
[root@localhost etc]#source profil