linux下配置jdk
1.下载jdk.....tar.gz
2.解压到 /usr/local/src
3.vim /etc/profile 添加下面的代码
export JAVA_HOME=/usr/local/src/jdk1.8.0_181 export JRE_HOME=$JAVA_HOME/jre export CLASSPATH=$JAVA_HOME/lib/ export PATH=$PATH:$JAVA_HOME/bin
4.使配置生效
source /etc/profile
4.测试
[root@iZm5e1y15z8ms94adqia7hZ /]# java -version java version "1.8.0_181" Java(TM) SE Runtime Environment (build 1.8.0_181-b13) Java HotSpot(TM) 64-Bit Server VM (build 25.181-b13, mixed mode)