1. 安装java
mkdir -p /home/java
tar -zxvf jdk-8u391-linux-x64.tar.gz -C /home/java
cd /home/java
cd jdk1.8.0_391/
2. 配置java
vim /etc/profile ,最后加上
export JAVA_HOME=/home/java/jdk1.8.0_391export CLASSPATH=.:$JAVA_HOME/libexport PATH="$PATH:$JAVA_HOME/bin"\
source /etc/profilejava