先上传 jdk-8u251-linux-x64.tar.gz 包
mkdir /usr/java
tar -xzvf jdk-8u251-linux-x64.tar.gz -C /usr/java/
mv /usr/java/jdk1.8.0_251 /usr/java/jdk
vim /etc/profile
export JAVA_HOME=/usr/java/jdk
export PATH=$PATH:$JAVA_HOME/bin
source /etc/profile
java -version # 验证