Oracle官网:https://www.oracle.com/cn/java/
1.安装jdk
tar -zxvf jdk-8u131-linux-x64.tar.gz
mkdir /usr/java
mv jdk1.8.0_131 /usr/java/
2.修改profile文件
vi /etc/profile
export JAVA_HOME=/usr/java/jdk1.8.0_131
export JRE_HOME=${JAVA_HOME}/jre
export CLASSPATH=.:${JAVA_HOME}/lib:${JRE_HOME}/lib:$CLASSPATH
export JAVA_PATH=${JAVA_HOME}/bin:${JRE_HOME}/bin
export PATH=$PATH:${JAVA_PATH}
source /etc/profile
查看版本
java -version