#安装 openjdk:
http://jdk.java.net/ 下载地址
wget https://download.java.net/java/GA/jdk12.0.2/e482c34c86bd4bf8b56c0b35558996b9/10/GPL/openjdk-12.0.2_linux-x64_bin.tar.gz
tar -zxvf openjdk-12.0.2_linux-x64_bin.tar.gz -C /usr/
#添加环境变量:/etc/profile
#openjdk env
export JAVA_HOME=/usr/jdk-12.0.2
export CLASSPATH=.:$JAVA_HOME/jre/lib/rt.jar:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
export PATH=$PATH:$JAVA_HOME/bin
source /etc/profile #使环境变量生效
验证 openjdk:
java -version
javac
java