I installed it according to the link on the right, but the first step is different oh. Http://www.cnblogs.com/spiders/archive/2016/09/06/5845727.html
1. Download the RPM installation file.
1.1 via command line: Curl-o http://download.oracle.com/otn-pub/java/jdk/8u111-b14/jdk-8u111-linux-x64.rpm
1.2 Because the first method was unsuccessful, I downloaded the rpm installation file locally and then uploaded it to the CentOS server via xftp (step reference http://www.cnblogs.com/joytree/p/6241137.html). Baidu Network disk: Https://pan.baidu.com/s/1c2CBA6G Extract password: rtt2
2. Installing using the RPM command
RPM-IVH jdk-8u111-linux-x64.rpm
3. Setting Environment variables
Vi/etc/profile
Add the following to the file:
#set Java Environment
java_home=/usr/java/jdk1.8.0_111
Jre_home=/usr/java/jdk1.8.0_111/jre
Class_path=.: $JAVA _home/lib/dt.jar: $JAVA _home/lib/tools.jar: $JRE _home/lib
Path= $PATH: $JAVA _home/bin: $JRE _home/bin
Export Java_home jre_home Class_path PATH
Make a file effective
Source/etc/profile
4. Verification
Java-version
Centos installation jdk1.8