1. Upload the compressed package to the /opt directory of the Linux server through Xftp
2. Unzip to the /usr/local/ directory
tar -zxvf jdk-8u161-linux-x64.tar.gz -C /usr/local/
3. Modify the configuration file /etc/profile and configure environment variables
vim /etc/profile
#set java environment;
JAVA_HOME=/usr/local/jdk1.8.0_161 #注意#修改为自己的路径,和jdk文件名
CLASSPATH=.:$JAVA_HOME/lib.tools.jar
PATH=$JAVA_HOME/bin:$PATH
export JAVA_HOME CLASSPATH PATH
4. Refresh the configuration file to check whether the installation is successful
1. source /etc/profile
2. java -version
#出现jdk版本即安装成功