Deploy Alibaba Dragonwell JDK

更新时间:
复制 MD 格式

Alibaba Dragonwell is Alibaba's internal OpenJDK implementation. It is optimized for online e-commerce, finance, and logistics applications that run on more than 100,000 servers. Alibaba Dragonwell powers these distributed Java applications and provides exceptional extensibility.

  • Alibaba Dragonwell offers two editions:

    • Standard Edition: Based on upstream OpenJDK, with enhancements such as bug fixes, security patches, and tooling support.

    • Extended Edition: Includes all the features of the Standard Edition and adds further optimizations for cloud environments. This edition is widely used in the Alibaba production environment.

  • Alibaba Dragonwell JDK is available in versions that support both the Linux and Windows operating systems.

    • Dragonwell 8

    • Dragonwell 11

    • Dragonwell 17 (Standard Edition only)

    • Dragonwell 21

Linux

Note

If you are using Alibaba Cloud Linux 3, you can use the yum command to install. When you use yum, a symbolic link is created by default, and you do not need to set environment variables.

  • Dragonwell 8: sudo yum install -y java-1.8.0-alibaba-dragonwell-devel

  • Dragonwell 11: sudo yum install -y java-11-alibaba-dragonwell-devel

  • Dragonwell 17: sudo yum install -y java-17-alibaba-dragonwell-devel

  • Dragonwell 21: sudo yum install -y java-21-alibaba-dragonwell-devel

For other Linux systems, follow the steps below.

  1. Go to the Dragonwell official website. Select the appropriate options and click the download button to obtain the installation package, or right-click the button to copy the download link.

    • Region: China Mainland.

    • Edition: Standard Edition or Extended Edition.

    • JDK version: Dragonwell 8, 11, 17 (Standard Edition only), or 21.

    • System architecture: x86_64 or aarch64. To confirm your system architecture, run the uname --machine command.

    • Operating system: Linux.

  2. Download the installation package.

    Note

    This topic uses the /usr/local/ path as an example. If you use a different path, make sure to update it in the subsequent steps.

    • If your instance has Internet access, run the following command to download the package. This example uses the Extended Edition of Dragonwell 8 for the x86_64 architecture. For other versions or architectures, obtain the correct URL from the Dragonwell official website and replace the URL in the command.

      sudo wget -P /usr/local https://dragonwell.oss-cn-shanghai.aliyuncs.com/8.20.21/Alibaba_Dragonwell_Extended_8.20.21_x64_linux.tar.gz
    • If your instance cannot access the public network, you can use Workbench to upload or download files.

  3. Extract the Java package.

    1. Switch to the target directory.

      cd /usr/local/
    2. Run the tar command to extract the Java package. Replace <package> with the actual package file name. For example, if the package name is Alibaba_Dragonwell_Extended_8.20.21_x64_linux.tar.gz, the command is sudo tar -zxvf Alibaba_Dragonwell_Extended_8.20.21_x64_linux.tar.gz.

      sudo tar -zxvf <package>
  4. Navigate to the extracted directory.

    1. Change to the directory where the Java package was extracted. Replace <xxx> with the actual directory name. For example, if the extracted directory is named dragonwell-8.20.21, the command is cd dragonwell-8.20.21.

      cd <xxx>
    2. Display the full path of the current directory.

      sudo pwd
  5. Set environment variables.

    1. Add the Java installation directory to the JAVA_HOME environment variable. Replace <path> with the full path of the Java installation directory. For example, if the full path is /usr/local/dragonwell-8.20.21, the command is echo "export JAVA_HOME=/usr/local/dragonwell-8.20.21" | sudo tee -a /etc/profile.

      echo "export JAVA_HOME=<path>" | sudo tee -a /etc/profile
    2. Update the PATH environment variable to include the path to Java executables.

      echo "export PATH=\$PATH:\$JAVA_HOME/bin" | sudo tee -a /etc/profile
    3. The changes to the environment variable take effect immediately.

      source /etc/profile
  6. Run the following command to verify the installation and view the version information.

    java -version

    image

Windows

  1. On your Windows instance, open a browser and go to the Dragonwell official website. Select the appropriate options and download the installation package.

    • Region: China Mainland.

    • Edition: Standard Edition or Extended Edition.

    • JDK version: Dragonwell 8, 11, or 21.

    • System architecture: x86_64 or aarch64.

    • Operating system: Windows.

  2. Go to the Program Files folder on the C drive and locate the Java installation package. The following figure uses Dragonwell 8 as an example.

    Note

    This topic uses the C:/Program Files path as an example. If you use a different path, make sure to update it in the subsequent steps.

    image

  3. Extract the Java installation package and navigate to the extracted folder. Copy the absolute address from the address bar. The following figure uses Dragonwell 8 as an example.image

  4. Set environment variables.

    1. Right-click This PC and select Properties.image

    2. On the About page, scroll down and click Advanced system settings.image

    3. Click Environment Variables.image

    4. In the System variables section, click New. In the New System Variable window, enter JAVA_HOME as the variable name and the absolute address that you copied as the variable value. Click OK.image

    5. In System variables, find and select Path, and then click Edit.image

    6. Add the following two paths.

      %JAVA_HOME%\bin
      %JAVA_HOME%\jre\bin

      image

    7. Click OK twice to save the settings.image

  5. Press Win+R to open the Run dialog box, type cmd, and press Enter to open a command prompt window. Run the following command to verify the installation and view the version information.

    java -version

    image