下载地址

https://repo.huaweicloud.com:8443/artifactory/java-local/jdk/

1.下载

cd /usr/local/
wget wget https://repo.huaweicloud.com:8443/artifactory/java-local/jdk/8u202-b08/jdk-8u202-linux-x64.tar.gz
tar -zxf jdk-8u202-linux-x64.tar.gz

2.配置

vim /etc/profile
##添加以下内容
export JAVA_HOME=/usr/local/jdk1.8.0_202

export JRE_HOME=/usr/local/jdk1.8.0_202/jre

export CLASS_PATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar:$JRE_HOME/lib

3.重新加载环境变量

source /etc/profile

4.查看版本

java -version