1 去官网下载linux jdk

https://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html

2 解压

3 配置环境变量

vim /etc/profile

export JAVA_HOME=/usr/java/jdk1.8.0_191/
export JRE_HOME=/usr/java/jdk1.8.0_191/jre
export CLASSPATH=.:$CLASSPATH:$JAVA_HOME/lib:$JRE_HOME/lib
export PATH=$PATH:$JAVA_HOME/bin:$JRE_HOME/bin