Centos6.6 install jdk1.7
1. view the jdk version installed by the System
# Java-version
# Rpm-qa | grep jdk
# Yum remove-y java-1.7.0-openjdk-1.7.0.99-2.6.5.0.el6_7.x86_64
# Yum remove-y java-1.6.0-openjdk-1.6.0.0-11.1.13.4.el6.x86_64
2. Delete the original jdk1.8
# Cd/usr/local/
# Rm-rf jdk
# Rm-rf jdk1.8.0 _ 73
3. Go to the directory and upload
# Cd/server/tools/
# Rz-y
Jdk-7u79-linux-x64.gz
4. Install jdk1.7
# Tar jdk-7u79-linux-x64.gz-C/usr/local/
# Ln-s/usr/local/jdk1.7.0 _ 79 // usr/local/jdk
# Chown-R root. root/usr/local/jdk
5. Configure java environment variables
# Vim/etc/profile
Add at the end
Export JAVA_HOME =/usr/local/jdk
Export PATH = $ JAVA_HOME/bin: $ JAVA_HOME/jre/bin: $ PATH
Export CLASSPATH =. $ CLASSPATH: $ JAVA_HOME/lib: $ JAVA_HOME/jre/lib: $ JAVA_HOME/lib/tools. jar
Configuration takes effect
# Source/etc/profile
6. View jdk version information
# Java-version
Java version "1.7.0 _ 79"
Java (TM) SE Runtime Environment (build 1.7.0 _ 79-b15)
Java HotSpot (TM) 64-Bit Server VM (build 24.79-b02, mixed mode)