Install Java under centos

1. Unzip

First put the compressed package in the /usr/local path, unzip it

 cd /usr/local
 tar -zxvf jdk-13.0.2_linux-x64_bin.tar.gz 
 #改名
 mv jdk-13.0.2 java

insert image description here

2. Configure environment variables

open profile file

vim /etc/profile

Add the path configuration to the end

export JAVA_HOME=/usr/local/java
export PATH=$PATH:$JAVA_HOME/bin

insert image description here
Let the configuration take effect

source /etc/profile

view version

java -version

If there is version number information, the configuration is successful
insert image description here

Guess you like

Origin blog.csdn.net/worilb/article/details/127285964