Summary:
The JDK installed in general is OPENJDK, but OpenJDK is obviously missing part of the source code, so download the JDK installation, this article installs the JDK version is: jdk-7u79.
1. First download JDK version to Oracle website
Website: http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html
2, upload files to CentOS, I use lrzsz tools to upload, you can also use FTP upload.
1) Create a folder
Mkdir/usr/local/java
2) upload the file to the Java directory
3) Unzip
TAR-ZXVF jdk-7u79-linux-x64.tar.gz
4) Modify the/etc/profile configuration file
Vi/etc/profile
Add at the end of the file
Export java_home=/usr/local/java/jdk1.7. 0_79export jre_home=/usr/local/java/jdk1.7.0_79/jreexport PATH= $PATH:/usr/local/java/jdk1.7.0_79/binexport CLASSPATH=./:/usr/local/java/jdk1.7.0_79/lib:/ Usr/local/java/jdk1.7.0_79/jre/lib
5) Make the configuration file effective
Source/etc/profile
6) Verify that the JDK is installed successfully
Java-version
If prompted as shown, the installation is successful.
Centos 6.7 Installation JDK