centos7 decompress and install jdk

Centos7 decompresses and installs JDK, configures environment variables

Download the jdk file, what I downloaded here is jdk-10.0.1_linux-x64_bin.tar.gz

Create a directory: mkdir /usr/java Move files: mv jdk-10.0.1linux-x64bin.tar.gz /usr/java Extract JDK: tar -zxvf jdk-10.0.1linux-x64bin.tar.gz

centos7 is a bit different from the previous version in the configuration of environment variables

vim /etc/profile

Add the following sentences at the end #only the directory of JAVA_HOME needs to be changed#set jdk

export JAVA_HOME=/usr/java/jdk-10.0.1

export CLASSPATH=.:${JAVA_HOME}/jre/lib/rt.jar:${JAVA_HOME}/lib/dt.jar:${JAVA_HOME}/lib/tools.jar

export PATH=${JAVAHOM}E/bin:$PATH

keep

Make the configuration file take effect: source /etc/profile

java -version View jdk information.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324927383&siteId=291194637