Azul Recognizes Winners of its Inaugural 2024 Azul Java Hero Awards for Innovative, World-Class Java Deployments
Blog chevron_right Java

The Definitive Guide to Updating Azul Zulu Builds of OpenJDK

Staying up-to-date with your JVM version is crucial for several reasons, including access to the latest features and updates for critical security vulnerabilities. By updating software versions, you can benefit from the following:

  • Improved functionality: Take advantage of enhanced features and functionalities.
  • Enhanced security: Fix vulnerabilities found in previous versions.
  • Bug fixes and stability: Address bugs and stability issues present in older versions.
  • Optimized performance: Apply performance optimizations that can improve the efficiency and speed of the application.
  • Compatibility with newer technologies: Keep software compatible with new hardware, operating systems, and other emerging technologies.
  • Access to new features: Use new features, tools, and functionalities unavailable in previous versions.

There is no need to worry. Following this page will make your JVM environment update quick, smooth, and simple!

Update versus upgrade

We use the term update here to describe installing a newer build of the same major release, for example, upgrading from 17.0.8 to 17.0.9. Such an update generally brings little risk and only needs limited testing.

The term upgrade is used when you move to a newer major release, for instance, from JDK 17 to 21. An upgrade brings more risk and needs extensive testing.

Our blog post “Should You Update Java or Upgrade?” describes the difference between an update and an upgrade in more detail.

Related Content

Updating your current JVM

Do I need to uninstall my current JVM first?

As with most software-related questions, the answer is “it depends.” A Java program is usually executed with java -jar my_app.jar, where the java command is linked to a specific location on your computer where the Java runtime has been installed. This link is established via the system PATH environment variable.

When installing a new Java update or upgrade, the PATH value will most likely be overwritten to point to the latest installed version. This can result in multiple Java runtimes installed on your system in various locations.

If you only want to use the latest version, it’s recommended that you uninstall any previous versions before installing a new one. This will also help you keep your system clean and you will not lose any disk space with unused Java runtimes.

Will multiple versions cause conflicts?

No. As the java command can only be related to one specific location, multiple versions will not conflict.

What is the benefit of having different versions?

As one use case, developers who want to compare the performance of new features on different versions may benefit from having those versions on their computers. By starting your application with the full location of the Java executable, you don’t need to update the PATH environment variable.

For instance, on a macOS system:

$ /Library/Java/JavaVirtualMachines/zulu-17.jdk/Contents/Home/bin/java -jar my_app.jar

How can I know if I have one or more versions installed?

Depending on the version and distribution, Java can be installed in various locations on your system. These are the most typical locations:

  • MacOS: /Library/Java/JavaVirtualMachines/
  • Windows: C:\Program Files\Java\
  • Linux: /usr/lib/jvm

A handy tool to monitor the installed Java versions on a macOS 14+ system is JDK Updater by Gerrit Grunwald.

Special cases

There are a few special cases you need to take into account for specific systems and versions:

  • Packages Installed with RPM and DEB Installers before October 2023
  • Updating Azul Zulu 8.68

For all the information about these special cases, check the update instructions in the Azul Zulu documentation.

Updating your JVM

If you are on Linux or macOS, consider using SDKMAN to install one or more versions of Java.

Windows and macOS

You can update to a newer version by executing the installation steps described on one of the following links. The existing installation will be overwritten when you update an already installed version (for example, from 21.0.1 to 21.0.2).

When you upgrade to a newer major version (for example, installing version 22 on a computer with 21), the already installed version will not be removed. Still, it will no longer be used by the java command and will take up storage space that can be freed by uninstalling it first.

Linux

You can update all installed packages on your Linux system using the package manager you used for the installation.

Update a Debian-based system (Ubuntu, Mint, Raspberry Pi OS,…):

sudo apt update
sudo apt upgrade

Update an RPM-based system (CentOS, Fedora,…):

sudo yum update

Uninstalling your current JVM

You can find detailed information for each platform on the following pages:

Conclusion

Using a newer build of the same version of Azul Zulu is very straightforward. For instance, it is possible to keep different versions on your system to compare them. In most cases, you don’t need to remove the previous version, but it’s still preferred as this will free storage space on your system. The Azul Platform Core documentation contains all the up-to-date installation, removal, and update instructions.

We Love to Talk About Java

Ask us anything about Java versions and features.