How to install openJDK on CentOS

藏色散人
Release: 2021-06-23 10:16:09
Original
3000 people have browsed it
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 the rootuser. If there is a permission problem, please switch to the rootuser 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
How to install openJDK on CentOS

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)
How to install openJDK on CentOS

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
How to install openJDK on CentOS

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

How to install openJDK on CentOS

Installation package decompression

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

How to install openJDK on CentOS

Configure environment variables

Executevim /etc/profile, configure environment variables

Configuration JAVA_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

How to install openJDK on CentOS

Reload environment
source /etc/profile

Verify

java -version
How to install openJDK on CentOS

The above is the detailed content of How to install openJDK on CentOS. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!