- 解压
tar -zxvf /usr/local/jdk-11.0.2.tar.gz -C /usr/local -
配置环境变量
vi /etc/profile# java Path export JAVA_HOME=/usr/local/jdk-11.0.2 export CLASSPATH=$JAVA_HOME/lib:$CLASSPATH export PATH=$JAVA_HOME/bin:$PATH
- 重启环境
source /etc/profile - 查看
java –version