Installing OpenJDK
- Download and decompress the installation package to a directory (for example, /opt/tools/installed/).
1 2 3 4
wget https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u252-b09/OpenJDK8U-jdk_aarch64_linux_hotspot_8u252b09.tar.gz tar -zxf OpenJDK8U-jdk_aarch64_linux_hotspot_8u252b09.tar.gz mkdir -p /opt/tools/installed/ mv jdk8u252-b09 /opt/tools/installed/
- Configure Java environment variables.
- Open the /etc/profile file.
1vi /etc/profile - Press i to enter the insert mode and add the following content to the end of the file:
1 2
export JAVA_HOME=/opt/tools/installed/jdk8u252-b09 export PATH=$JAVA_HOME/bin:$PATH
- Press Esc, type :wq!, and press Enter to save the file and exit.
- Open the /etc/profile file.
- Make the environment variables take effect.
1source /etc/profile
- Check whether OpenJDK is successfully installed.
1java -versionThe installation is successful if information similar to the following is displayed:

Parent topic: Configuring the Compilation Environment