1.下载压缩包
https://www.oracle.com/technetwork/java/javase/downloads/
2.解压
sudo tar -zxvf jdk-8u201-linux-x64.gz
3.移动到系统lib目录
sudo mv jdk1.8.0_201 /usr/lib/jvm
3.更新bashrc环境变量
$sudo vim ~/.bashrc
set oracle jdk environment
export JAVA_HOME=/usr/lib/jvm/jdk1.8.0_201
export JRE_HOME={JAVA_HOME}/lib:{JAVA_HOME}/bin:source ~/.bashrc
4.完成
$java -version