install jdk

1.1 Decompress jdk

Create a java folder where users store Java files

mkdir /usr/local/java

Upload the downloaded jdk installation package to the java folder through the ftp tool.

1.png

Unzip:

cd /usr/local/java
tar -vxzf jdk-8u181-linux-x64.tar.gz

After the decompression is successful, you will see in the current directory:

jdk1.8.0_181folder

Then delete the installation package:

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

1.2 Configure jdk

Set environment variables:

vim /etc/profile

Add at the end:

JAVA_HOME=/usr/local/java/jdk1.8.0_181
PATH=$PATH:$HOME/bin:$JAVA_HOME/bin
export JAVA_HOME
export PATH

Reload the configuration file for environment variables:

source /etc/profile

Detection:

java -version

2.png

{{o.name}}
{{m.name}}

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=324064432&siteId=291194637