1:解压 tar -zxvf jdk-8u251-linux-x64.tar.gz
2:配置环境变量
vim /etc/profile
末尾添加
export JAVA_HOME=/data/jdk/jdk1.8.0_251
export CLASSPATH=$:CLASSPATH:$JAVA_HOME/lib/
export PATH=$PATH:$JAVA_HOME/bin
执行:source /etc/profile
java -version
1:解压 tar -zxvf jdk-8u251-linux-x64.tar.gz
2:配置环境变量
vim /etc/profile
末尾添加
export JAVA_HOME=/data/jdk/jdk1.8.0_251
export CLASSPATH=$:CLASSPATH:$JAVA_HOME/lib/
export PATH=$PATH:$JAVA_HOME/bin
执行:source /etc/profile
java -version