Install Azul Zulu on Alpine Linux
This section explains how to install Azul Zulu Builds of OpenJDK on Alpine Linux.
Install from Azul’s APK repository
This section shows how to install Azul Zulu from the Azul APK repository using the apk package manager.
Installing with the package manager requires root privileges.
Log in as root
or prefix the commands listed below with sudo
.
-
Set up the Azul APK repository:
# add Azul's public key sudo wget -P /etc/apk/keys/ \ https://cdn.azul.com/public_keys/[email protected] # add the Azul APK repository echo "https://repos.azul.com/zulu/alpine" | sudo tee -a /etc/apk/repositories # update the list of packages sudo apk update -
Install the required Azul Zulu package.
For example, to install Azul Zulu 11 JDK, run:
sudo apk add zulu21-jdk -
To verify your installation, run the
java -version
command. You should see output similar to the following:$ java -version openjdk version "21.0.4" 2024-07-16 LTS OpenJDK Runtime Environment Zulu21.36+17-CA (build 21.0.4+7-LTS) OpenJDK 64-Bit Server VM Zulu21.36+17-CA (build 21.0.4+7-LTS, mixed mode, sharing)
Install from binary TAR.GZ file
You can download and use the binary tar.gz
package, if necessary.
-
Download the appropriate
.tar.gz
package for your OS from Azul Downloads. -
Verify that the checksum of the file matches the value provided on the download page. To calculate the checksum, use this command:
sha256sum <package>.tar.gzExample output:
$ sha256sum zulu21.36.17-ca-jdk21.0.4-linux_x64.tar.gz 318d0c2ed3c876fb7ea2c952945cdcf7decfb5264ca51aece159e635ac53d544 zulu21.36.17-ca-jdk21.0.4-linux_x64.tar.gz -
Extract the package content into a folder.
tar -xzvf <package>.tar.gzThis command creates a folder named to match the installation package name without
.tar.gz
. This is your Azul Zulu installation folder. -
Verify that the package was unpacked successfully by running the following command:
$ <installation_folder>/bin/java -version openjdk version "21.0.4" 2024-07-16 LTS OpenJDK Runtime Environment Zulu21.36+17-CA (build 21.0.4+7-LTS) OpenJDK 64-Bit Server VM Zulu21.36+17-CA (build 21.0.4+7-LTS, mixed mode, sharing) -
(Optional) Add
<installation_folder>/bin
to yourPATH
environment variable, so that you can executejava
from any directory without specifying the full path.export PATH=<installation_folder>/bin:$PATH