JDK11 installation and configuration under Linux system

First, the Linux system comes with the JDK deleted

Here Insert Picture Description

Two, JDK11 installation

# 搜索安装包
yum search java-11-openjdk
# 安装
yum install -y java-11-openjdk

Here Insert Picture Description

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.
Here Insert Picture Description

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

Here Insert Picture Description

Published 76 original articles · won praise 16 · views 20000 +

Guess you like

Origin blog.csdn.net/weixin_38657051/article/details/102541768