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 zulu11-jdk -
To verify your installation, run the
java -version
command. You should see output similar to the following:$ java -version openjdk version "11.0.10" 2021-01-19 LTS OpenJDK Runtime Environment Zulu11.45+27-CA (build 11.0.10+9-LTS) OpenJDK 64-Bit Server VM Zulu11.45+27-CA (build 11.0.10+9-LTS, mixed mode)
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 zulu11.45.27-ca-jdk11.0.10-linux_x64.tar.gz 0bd85593bae021314378f3b146cfe36a6c9b0afd964d897c34201034ace3e785 zulu11.45.27-ca-jdk11.0.10-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 "11.0.10" 2021-01-19 LTS OpenJDK Runtime Environment Zulu11.45+27-CA (build 11.0.10+9-LTS) OpenJDK 64-Bit Server VM Zulu11.45+27-CA (build 11.0.10+9-LTS, mixed mode) -
(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