1. Environmental description
System: centos6.7, 2.6.32-573.el6.x86_64; Jdk:jdk1.7.0_80
2. Download the JDK and upload it
Download Jdk-7u80-linux-x64.tar.gz,crt upload to the/opt directory
3. Decompression
TAR-ZXVF jdk-7u80-linux-x64.tar.gz
4. Environment variable Configuration
Vi/etc/profile;
Add the following at the end:
# jdk1.7.0_80 Settings
Java_home=/opt/jdk1.7.0_80
Jre_home= $JAVA _home/jre
Path= $PATH: $JAVA _home/bin: $JRE _home/bin
Classpath=: $JAVA _home/lib/dt.jar: $JAVA _home/lib/tools.jar: $JRE _home/lib
Export Java_home jre_home PATH CLASSPATH
The source/etc/profile is then executed to make the configuration effective.
5. Testing
# java-version
Java Version "1.7.0_80"
Java (TM) SE Runtime Environment (build 1.7.0_80-b15)
Java HotSpot (TM) 64-bit Server VM (build 24.80-b11, Mixed mode)
Test success!
JDK installation of CentOS