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
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
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