All Products
Search
Document Center

Elastic Compute Service:Deploy Alibaba Dragonwell JDK

Last Updated:Dec 19, 2024

Alibaba Dragonwell is the in-house OpenJDK implementation in Alibaba Cloud. Alibaba Dragonwell is optimized for online e-commerce, finance, and logistics applications that are running on more than 100,000 servers. Alibaba Dragonwell is the engine that runs distributed Java applications, which enables extreme scaling.

  • Alibaba Dragonwell provides the following editions:

    • Standard edition: Based on the upstream OpenJDK, the Standard edition is incorporated with enhancements, such as bug fixes, security patches, and tool support.

    • Extended edition: includes all Standard edition features and provides optimization for the cloud environment. The Extended edition has various use cases in the Alibaba Cloud production environment.

  • The following Alibaba Dragonwell JDK versions support Linux and Windows operating systems:

    • Dragonwell 8

    • Dragonwell 11

    • Dragonwell 17 (Standard edition only)

    • Dragonwell 21

Linux

Note

In Alibaba Cloud Linux 3, you can run one of the following yum commands to install Alibaba Dragonwell JDK. After installation, symbolic links are automatically configured. You do not need to configure environment variable settings.

  • 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 distributions, perform the following steps to install Alibaba Dragonwell JDK.

  1. Go to the Dragonwell website, select the corresponding options, and click the download button to obtain the installation package or right-click the package name to obtain the download URL.

    • Region: United States.

    • Version: Standard edition or Extended edition.

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

    • Architecture: x86_64 or aarch64. To determine the suitable installation package for your operating system, run the uname --machine command to check the operating system architecture.

    • Operating system type: Linux.

  2. Download the installation package.

    Note

    In this example, the /usr/local/ directory is used. You can change the directory. If you change the directory, you must change the directory for subsequent operations.

    • If your instance can access the Internet, you can run the following command to download the installation package. In this example, Dragonwell 8 of the Extended edition and the x86_64 architecture is used. For other editions or architectures, you must obtain the download URL from the Dragonwell website and use the new URL to replace the URL parameter 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 Internet, you can log on to the instance by using Workbench to download the installation package. For more information, see Use Workbench to upload a file to and download a file from an instance.

  3. Decompress the Java installation package.

    1. Switch to the destination directory.

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

      sudo tar -zxvf <Package name>
  4. Go to the directory in which you decompressed the installation file.

    1. Go to the directory in which the Java installation package is decompressed and replace <Directory name> with the actual directory name. For example, if the directory name is dragonwell-8.20.21, change the command to cd dragonwell-8.20.21.

      cd <Directory name>
    2. View the full directory.

      sudo pwd
  5. Configure environment variables.

    1. Add the directory in which the Java installation package is stored to the JAVA_HOME environment variable. Replace <Path> with the full path to the Java installation directory. For example, if the full path is /usr/local/dragonwell-8.20.21, change the command to 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 directory in which the executable Java file is stored.

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

      source /etc/profile
  6. Run the following command to check whether Java is installed and whether the version information is displayed. The command output shown in the following figure indicates that Java is installed.

    java -version

    image

Windows

  1. Open the browser of a Windows instance and go to the Dragonwell website. You must select the corresponding options to download the installation package.

    • Region: The United States.

    • Version: Standard edition or Extended edition.

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

    • Operating system architecture: x86_64 or aarch64.

    • Operating system type: Windows.

  2. Go to the Program Files folder on disk C and find the Java installation package. In this example, Dragonwell 8 is used.

    Note

    In this example, the C:/Program Files directory is used. You can change the directory. If you change the directory, you must change the directory for subsequent operations.

    image

  3. Decompress the Java installation package, go to the directory in which the decompressed package is stored, and obtain the full address in the address bar. In this example, Dragonwell 8 is used.image

  4. Configured environment variables.

    1. Right-click This PC and select Properties from the drop-down list. image

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

    3. In the System Properties dialog box, click Environment Variables on the Advanced tab.image

    4. In the Environment Variables dialog box, click New in the System variables section. In the New System Variable dialog box, set Variable name to JAVA_HOME and Variable value to the previously obtained directory in which the Java package is decompressed. Then, click OK to save the system variable settings.image

    5. In the Environment Variables dialog box, find and click Path in the Variable column of the System variables section and then click Edit. image

    6. Create two new paths as shown below:

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

      image

    7. Click OK twice to save the environment variable settings.

      image

  5. Press Win+R to open the Run dialog box, enter cmd, and then press the Enter key to open the Command Prompt window. Run the following command to check whether Java is installed and whether the version information is displayed. The command output shown in the following figure indicates that Java is installed.

    java -version

    image