Windows Install
Linux Install
1.Create a directory to where you want to download the archive file, and then navigate to that directory on your command-line interface (CLI).
cd /opt
mkdir OpenJdk
pwd
/opt/OpenJdk
2.download the JDK archive for Linux to your local system.
https://access.redhat.com/jbossnetwork/restricted/listSoftware.html?downloadType=distributions&product=core.service.openjdk&version=11.0.15
3.Extract the contents of the archive to a directory of your choice:
pwd
/opt/OpenJdk
tar -xf java-11-openjdk-11.0.15.0.9-3.portable.jdk.el.x86_64.tar.xz
mv java-11-openjdk-11.0.15.0.9-3.portable.jdk.el.x86_64 Jdk11
4.editor /etc/profile,Configure the JAVA_HOME environment variable:
vim /etc/profile
## 按大G健,切换最后一行,添加以下内容
export JAVA_HOME=/opt/OpenJdk/Jdk11
export PATH="$JAVA_HOME/bin:$PATH"
上面的第二行内容的目的是:
Add the bin directory of the generic JRE path to the PATH environment variable
5.生效
# 使配置文件生效
source /etc/profile
# verify
printenv | grep JAVA_HOME
java -version