1.解压
root@headean-PC:/home/headean/Downloads# tar -zxvf jdk-14.0.1_linux-x64_bin.tar.gz -C /opt/jdk
2.进入 etc
root@headean-PC:/# cd etc
3.编辑 profile 文件
root@headean-PC:/etc# vi profile
done
export JAVA_HOME=/opt/jdk/jdk-14.0.1
export CLASSPATH=$JAVA_HOME/lib/
export PATH=$PATH:$JAVA_HOME/bin
export PATH JAVA_HOME CLASSPATH
unset i
if
4.生效
root@headean-PC:/etc# source /etc/profile
5.查看 JDK
root@headean-PC:/# java -version
java version "14.0.1" 2020-04-14
Java(TM) SE Runtime Environment (build 14.0.1+7)
Java HotSpot(TM) 64-Bit Server VM (build 14.0.1+7, mixed mode, sharing)
root@headean-PC:/#