下载

下载页面: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并解压

  1. 上传JDK压缩包到/usr/local目录: jdk1.8.0_144.tar.gz
  2. 解压文件:

    1. tar -xvf jdk1.8.0_144.tar.gz
  3. 解压成功即可

    1. tar -zxvf Alibaba_Dragonwell_8.10.11_x64_linux.tar.gz -C /usr/local/

配置环境变量

  1. 修改profile文件:vi /etc/profile
  2. 添加配置信息

    1. export JAVA_HOME=/usr/local/jdk1.8.0_144
    2. export JRE_HOME=/usr/local/jdk1.8.0_144/jre
    3. export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar:$JRE_HOME/lib:$CLASSPATH
    4. export PATH=$JAVA_HOME/bin:$PATH

    /usr/local/dragonwell-8.10.11

    1. export JAVA_HOME=/usr/local/dragonwell-8.10.11
    2. export JRE_HOME=/usr/local/dragonwell-8.10.11/jre
    3. export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar:$JRE_HOME/lib:$CLASSPATH
    4. export PATH=$JAVA_HOME/bin:$PATH

    source /etc/profile

  3. 测试配置:java -version

    1. [root@hadoop101 ~]# java -version
    2. java version "1.8.0_144"
    3. Java(TM) SE Runtime Environment (build 1.8.0_144-b01)
    4. Java HotSpot(TM) 64-Bit Server VM (build 25.144-b01, mixed mode)