官网地址
[root@localhost ~]# mkdir /var/local/jdk [root@localhost ~]# tar -zxvf jdk-8u202-linux-x64.tar.gz -C /var/local/jdk/
[root@localhost ~]# vim /etc/profile
在最后,添加
export JAVA_HOME=/var/local/jdk/jdk1.8.0_202 export PATH=$PATH:$JAVA_HOME/bin
刷新配置
[root@localhost ~]# source /etc/profile
[root@localhost ~]# javac