Centos7安装OpenJDK
下载地址:openJDK:http://openjdk.java.net/
openJDK11下载链接:https://download.java.net/openjdk/jdk11/ri/openjdk-11+28_linux-x64_bin.tar.gz
## 下载openJDK11
mkdir -p /u01/jdk/jdk11
[root@localhost jdk11]# wget https://download.java.net/openjdk/jdk11/ri/openjdk-11+28_linux-x64_bin.tar.gz
## 进入下载目录
cd /u01/java/jdk
## 创建解压目录
mkdir openjdk11
## 解压
[root@localhost jdk11]# tar xvf openjdk-11+28_linux-x64_bin.tar.gz -C openjdk11/
#环境变量配置
vi /etc/profile
在profile末尾增加如下:
#java
export JAVA_HOME=/u01/java/jdk/jdk11/openjdk11/jdk-11
export PATH=$JAVA_HOME/bin:$PATH
export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib
# 建立软连接
ln -s /u01/java/jdk/jdk11/openjdk11/jdk-11/bin/java /usr/bin/java