下载
下载页面:https://github.com/alibaba/dragonwell8/releases
下载链接:https://github.com/alibaba/dragonwell8/releases/download/dragonwell-8.10.11_jdk8u322-ga/Alibaba_Dragonwell_8.10.11_x64_linux.tar.gz
上传JDK并解压
- 上传JDK压缩包到/usr/local目录: jdk1.8.0_144.tar.gz
解压文件:
tar -xvf jdk1.8.0_144.tar.gz
解压成功即可
tar -zxvf Alibaba_Dragonwell_8.10.11_x64_linux.tar.gz -C /usr/local/
配置环境变量
- 修改profile文件:vi /etc/profile
添加配置信息
export JAVA_HOME=/usr/local/jdk1.8.0_144
export JRE_HOME=/usr/local/jdk1.8.0_144/jre
export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar:$JRE_HOME/lib:$CLASSPATH
export PATH=$JAVA_HOME/bin:$PATH
/usr/local/dragonwell-8.10.11
export JAVA_HOME=/usr/local/dragonwell-8.10.11
export JRE_HOME=/usr/local/dragonwell-8.10.11/jre
export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar:$JRE_HOME/lib:$CLASSPATH
export PATH=$JAVA_HOME/bin:$PATH
source /etc/profile
测试配置:java -version
[root@hadoop101 ~]# java -version
java version "1.8.0_144"
Java(TM) SE Runtime Environment (build 1.8.0_144-b01)
Java HotSpot(TM) 64-Bit Server VM (build 25.144-b01, mixed mode)