This article demonstrates the installation of openJDK in CentOS
This article is a personal technical sharing, if there are any errors or omissions, please Get in touch and make changes.
Note: Server operation is performed by therootuser. If there is a permission problem, please switch to therootuser or grant the relevant permissions to the current user. This article will not go into details
DownloadopenJDK
wget Download
wget https://download.java.net/java/GA/jdk13.0.2/d4173c853231432d94f001e99d882ca7/8/GPL/openjdk-13.0.2_linux -x64_bin.tar.gz
Manual download-upload to the server (when the server cannot connect to the Internet or the download is slow)
openJDK official website Or click directly to download openjdk-13.0.2_linux-x64_bin.tar.gz)
Check whether openJDK or other versions of JDK are installed on the server, and uninstall
Executerpm -qa |grep javaCheck whether JDK is installed on the server, or executejava,javac,java -version
Uninstall JDK on the server
Install openJDK
Prepare openJDK on the server. According to personal habits, copy openJDK to the specified directory. Some people like to install it in/usr/local/srcdirectory, some people like to install it in the/optdirectory
Copy the installation package to the installation path

Installation package decompression
Execute the installation package decompression commandtar -zxvf openjdk-13.0.2_linux-x64_bin.tar.gz

Configure environment variables
Executevim /etc/profile, configure environment variables
ConfigurationJAVA_HOME:export JAVA_HOME=/usr/local/src/jdk-13.0.2
Add the java bin directory to the system path:export PATH=$PATH:${JAVA_HOME}/bin

Reload environmentsource /etc/profile
Verify
java -version






























![[Web front-end] Node.js quick start](https://img.php.cn/upload/course/000/000/067/662b5d34ba7c0227.png)



