Install Azul Zulu on Linux and macOS with SDKMAN!
This section explains how to install Azul Zulu builds of OpenJDK with SDKMAN! on Linux and macOS.
Note
|
SDKMAN! is a tool for managing parallel versions of multiple Software Development Kits on most Unix based systems. It provides a convenient Command Line Interface (CLI) and API for installing, switching, removing and listing Candidates. |
By using SDKMAN!, you can install Azul Zulu Builds of OpenJDK with a single command:
$ sdk install java 19.0.2-zulu
Follow these steps for more detailed information.
Install SDKMAN!
Follow the installation guidelines provided on the SDKMAN! website.
Using SDKMAN!
List Available Java Versions
SDKMAN! detects your computer OS and platform and list all the available distributions and versions. For instance, on a macOS M1, all the Azul Zulu Builds of OpenJDK are listed:
$ sdk list java
================================================================================
Available Java Versions for macOS ARM 64bit
================================================================================
Vendor | Use | Version | Dist | Status | Identifier
--------------------------------------------------------------------------------
...
Zulu | | 19.0.2 | zulu | | 19.0.2-zulu
| | 19.0.2.fx | zulu | | 19.0.2.fx-zulu
| | 19.0.1 | zulu | | 19.0.1-zulu
| | 19.0.1.fx | zulu | | 19.0.1.fx-zulu
| | 17.0.6 | zulu | | 17.0.6-zulu
| | 17.0.6.fx | zulu | | 17.0.6.fx-zulu
| | 17.0.5 | zulu | | 17.0.5-zulu
| | 17.0.5.fx | zulu | | 17.0.5.fx-zulu
| | 11.0.18 | zulu | | 11.0.18-zulu
| | 11.0.18.fx | zulu | | 11.0.18.fx-zulu
| | 11.0.17 | zulu | | 11.0.17-zulu
| | 11.0.17.fx | zulu | | 11.0.17.fx-zulu
| | 8.0.362 | zulu | | 8.0.362-zulu
| | 8.0.362.fx | zulu | | 8.0.362.fx-zulu
| | 8.0.352 | zulu | | 8.0.352-zulu
| | 8.0.352.fx | zulu | | 8.0.352.fx-zulu
================================================================================
Install a Specific Version
To install a specific version, use the Identifier
value from the table.
$ sdk install java 19.0.2-zulu
Downloading: java 19.0.2-zulu
In progress...
######################################################################## 100.0%
Repackaging Java 19.0.2-zulu...
Done repackaging...
Installing: java 19.0.2-zulu
Done installing!
Setting java 19.0.2-zulu as default.
We can now check the installed Java version:
$ java -version
openjdk version "19.0.2" 2023-01-17
OpenJDK Runtime Environment Zulu19.32+13-CA (build 19.0.2+7)
OpenJDK 64-Bit Server VM Zulu19.32+13-CA (build 19.0.2+7, mixed mode, sharing)
Uninstalling
SDKMAN! also allows you to easily remove already installed Java versions:
$ sdk uninstall java 19.0.2-zulu
Deselecting java 19.0.2-zulu...
Uninstalling java 19.0.2-zulu...
Using SDKMAN! in Build Pipelines
With some extra configuration, it’s also possible to use SDKMAN! within your build pipelines to install additional tools required for your builds. This is an example extract from a GitLab pipeline:
maven_build:
stage: build
script:
- curl -s "https://get.sdkman.io" | bash
- source "$HOME/.sdkman/bin/sdkman-init.sh"
- sdkman_auto_answer=false
- sdkman_selfupdate_enable=false
- sdk install java 19-zulu
- sdk use java 19-zulu
- sdk install maven 3.8.6
- sdk use maven 3.8.6
- mvn package
Other Use Cases
Not only Java, but also a lot of other tools can be installed with SDKMAN!, e.g.:
-
ActiveMQ
-
Ant
-
Asciidoctor
-
JBake
-
Spring Boot
-
…
You can get the full list, including a lot of info with:
$ sdk list
================================================================================
Available Candidates
================================================================================
q-quit /-search down
j-down ?-search up
k-up h-help
--------------------------------------------------------------------------------
Apache ActiveMQ (Classic) (5.17.1) https://activemq.apache.org/
Apache ActiveMQ<C2><AE> is a popular open source, multi-protocol, Java-based message
broker...