JDK8
- 下载jdk8-64
- 上传到服务器
touch jdk8 //在服务器opt下创建
sudo scp ~/Downloads/jdk-8u301-linux-x64.tar.gz root@服务器ip:/opt/jdk8
- 环境变量
sudo vim /etc/profile
在profile最下面增加
export JAVA_HOME=/opt/jdk8/jdk1.8.0_301
export JRE_HOME=${JAVA_HOME}/jre
export CLASSPATH=.:${JAVA_HOME}/lib:${JRE_HOME}/lib:$CLASSPATH
export JAVA_PATH=${JAVA_HOME}/bin:${JRE_HOME}/bin
export PATH=$PATH:${JAVA_PATH}
esc :wq保存后,更新配置
source /etc/profile
[root@iZ2zecx60yof3y5gnh44w1Z ~]# java -version
java version "1.8.0_301"
Java(TM) SE Runtime Environment (build 1.8.0_301-b09)
Java HotSpot(TM) 64-Bit Server VM (build 25.301-b09, mixed mode)