Downloading the Installation package

Download the Linux installation package from the official website

Uploading the Installation Package

Go to /usr/local and create a new directory for the JDK

CD /usr/local mkdir Java ## directory nameCopy the code

Upload the downloaded JDK package to the newly created directory above

Decompress the installation package

Go to the corresponding directory and run the tar -zxvf jdK-8u291-linux-x64.tar. gz command to decompress the file.

X: extracts files from the tar package. Z: indicates that the tar package is compressed by gzip, so you need to use gunzip to decompress it. V: displays detailed informationCopy the code

Configuring environment Variables

Edit the /etc/profile file and add the following configuration at the end

Export JAVA_HOME=/usr/local/ Java /jdk1.8.0_291 export JRE_HOME=${JAVA_HOME}/jre export CLASSPATH=.:${JAVA_HOME}/lib:${JRE_HOME}/lib export PATH=${JAVA_HOME}/bin:$PATHCopy the code

Then type source /etc/profile for the environment variable configuration to take effect immediately.

validation

Enter java-version and javac respectively to view the installation

The JDK environment in Linux has been successfully installed.

Technical exchange QQ group: 816425449

This article uses the article synchronization assistant to synchronize