下载解压安装包 ``` cd /usr/local ``` ``` wget https://mirrors.huaweicloud.com/java/jdk/8u202-b08/jdk-8u202-linux-x64.tar.gz ``` ``` tar -zvxf jdk-8u202-linux-x64.tar.gz ``` 配置环境变量 ``` vim /etc/profile ``` 复制粘贴 ``` export JAVA_HOME=/usr/local/jdk1.8.0_202 export CLASSPATH=$:CLASSPATH:$JAVA_HOME/lib/ export PATH=$PATH:$JAVA_HOME/bin ``` 刷新 ``` source /etc/profile ``` 验证 ``` java -version ```