Visit Azul.com Support

Manage Multiple Azul Zulu Versions on Linux

Table of Contents
Need help?
Schedule a consultation with an Azul performance expert.
Contact Us

You can install different major versions of Azul Zulu on the same machine and switch between them when necessary.

Update PATH environment variable

You can add <zulu_installation_folder>/bin to your PATH environment variable.

 
export PATH=<zulu_installation_folder>/bin:$PATH

This makes all executables from <zulu_installation_folder>/bin available to Java programs from anywhere on your system. If you have previously added another version of Azul Zulu to PATH, just change the path to the version you want to use by default.

Change default "java" command

If you install multiple Azul Zulu versions using installable packages (DEB, RPM, and so on), you can use update-alternatives to set which java command is used by default.

To view the alternative java commands installed on your system, run:

 
$ sudo update-alternatives --config java There are 3 choices for the alternative java (providing /usr/bin/java). Selection Path Priority Status ------------------------------------------------------------ * 0 /usr/lib/jvm/zulu-15-amd64/bin/java 2152700 auto mode 1 /usr/lib/jvm/java-11-openjdk-amd64/bin/java 1111 manual mode 2 /usr/lib/jvm/zulu-15-amd64/bin/java 2152700 manual mode 3 /usr/lib/jvm/zulu8/jre/bin/java 1805201 manual mode Press <enter> to keep the current choice[*], or type selection number:

The command lists available java executables and lets you choose the default command. Type the number of the command and press Enter. You should see a messages similar to this:

 
update-alternatives: using /usr/lib/jvm/zulu8/jre/bin/java to provide /usr/bin/java (java) in manual mode

Verify that the default java command has changed:

 
java -version