jdk8 下载地址
oracle:https://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
azul:https://www.azul.com/downloads/?package=jdk
进到目录/usr/local/software
解压上传的jdk文件:
tar -zxvf jdk-8u201-linux-x64.tar.gz
重命名:
mv jdk1.8.0_201 jdk8
配置环境变量
vim /etc/profile
加入
export JAVA_HOME=/usr/local/software/jdk8
export PATH=$JAVA_HOME/bin:$PATH
export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
export JAVA_HOME PATH CLASSPATH
使用 source /etc/profile
让配置立刻生效