注:在安装之前先检查一下是否安装了,安装了就卸载
1、wget --no-cookies --no-check-certificate --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2F; oraclelicense=accept-securebackup-cookie" "http://download.oracle.com/otn-pub/java/jdk/8u65-b17/jdk-8u65-linux-x64.rpm"
2、rpm -Uvh jdk-8u65-linux-x64.rpm
3、cat > /etc/profile.d/java.sh << EOF
JAVA_HOME=/usr/java/latest
PATH=\$JAVA_HOME/bin:\$PATH
export JAVA_HOME PATH
EOF
4、source /etc/profile.d/java.sh
5、java -version
java version "1.8.0_65"
Java(TM) SE Runtime Environment (build 1.8.0_65-b17)
Java HotSpot(TM) 64-Bit Server VM (build 25.65-b01, mixed mode)