Linux offline installation of java8 environment

The steps for linux to install java environment are relatively simple.

1. Download the java8 package and upload it to the server /usr/local directory
Insert picture description here
2. Unzip: pay attention to the name of your package

tar -zxvf  /usr/local/jdk-8u181-linux-x64.tar.gz

Package name after decompression: jdk1.8.0_181
Insert picture description here
3. Configure environment variables:

vim /etc/profile

Add the following information to the configuration file, pay attention to the package name;

export JAVA_HOME=/usr/local/jdk1.8.0_181
export PATH=$JAVA_HOME/bin:$PATH
export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar

4. Update configuration

source /etc/profile

5. Verify that the java environment is successful, and see the screenshot of the information indicating success

java -version

Insert picture description here

Guess you like

Origin blog.csdn.net/qq_37488998/article/details/111983120