JDK11 installation and configuration under Linux system
First, the Linux system comes with the JDK deleted
Two, JDK11 installation
# 搜索安装包
yum search java-11-openjdk
# 安装
yum install -y java-11-openjdk
Third, set the JAVA_HOME
3.1, to identify the installation path of java
ls -lr $(which java)
ls -lrt /etc/alternatives/java
FIG red portion of the lower block is mounted in the path of JAVA.
3.2, set the JAVA_HOME
vim /etc/profile
We need to add an environment variable configuration
export JAVA_HOME=/usr/lib/jvm/java-11-openjdk-11.0.4.11-1.el7_7.x86_64/bin/java
export JRE_HOME=$JAVA_HOME/jre
export CLASSPATH=$JAVA_HOME/lib:$JRE_HOME/lib:$CLASSPATH
export PATH=$JAVA_HOME/bin:$JRE_HOME/bin:$PATH
# 刷新配置
source /etc/profile
# 测试配置是否生效
echo $JAVA_HOME