都是在普通用户加sudo代替root
1.sudo tar -zxvf jdk-8u201-linux-x64.tar.gz
2.sudo chown make:make jdk1.8.0/
3.sudo chmod -R 777 jdk1.8.0/
4.sudo mv jdk1.8.0/ jdk
5.cd /usr/local
6.sudo vi /etc/profile
zai wen jian zui hou zhui jia
export JAVA_HOME=/usr/local/jdk
export CLASSPATH=$CLASSPATH:$JAVA_HOME/lib/tools.jar:$JAVA_HOME/lib/dt.jar
export PATH=$PATH:$JAVA_HOME/bin:$JAVA_HOME/jre/bin
7.:wq!
8.source /etc/profile