Home  >  Article  >  Operation and Maintenance  >  How to install jdk in centos system

How to install jdk in centos system

王林
王林Original
2020-03-20 15:50:563835browse

How to install jdk in centos system

First download jdk on the jdk download page. Remember centos7 only supports 64-bit jdk, so you need to be careful when downloading to ensure that the number of downloaded jdk bits is correct

How to install jdk in centos system

Use linux management client ssh secure shell, upload the jdk8 you just downloaded and press subcontract, as shown in the figure below

How to install jdk in centos system

(recommended tutorial : centos usage tutorial)

Go to the uploaded directory and use the ll command to view the file list

How to install jdk in centos system

Use the command

tar -zxvf jdk-8u181-linux-x64.tar.gz

Extract the compressed package to the current directory

How to install jdk in centos system

After decompression is successful, use the ll command to view the file list. The compressed package is decompressed into the jdk1.8.0_181 folder

How to install jdk in centos system

Configure environment variables and modify the /etc/profile file

How to install jdk in centos system

Add the following environment variables, the code is as follows

JAVA_HOME=/usr/java/jdk1.8.0_181
CLASSPATH=$JAVA_HOME/lib/
PATH=$PATH:$JAVA_HOME/bin
export PATH JAVA_HOME CLASSPATH

How to install jdk in centos system

Reload the /etc/profile configuration file, the command is

source /etc/profile

How to install jdk in centos system

Check whether jdk is installed and configured successfully, the command is as follows

java -version

Print java version information

How to install jdk in centos system

Recommended related video tutorials: linux video tutorial

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

Statement:
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