Skip to content

Liberica JDK 21: Installation Guide

This guide describes how to install Liberica JDK 21.0.6+10 (LTS) on Microsoft Windows, Linux, and macOS computers. The type of installation you choose depends on your requirements and the platform you use.

There are several Liberica distribution variants:

  • JDK Standard — use it to run, compile, and debug applications or create your own Java Runtime with a subset of Java modules;
  • JDK Full — includes Liberica FX and an extended set of VMs;
  • JDK Lite — install it if you are looking for a smaller footprint, yet fully functional JDK;
  • JRE Standard — use it to run Java applications;
  • JRE Full — includes Liberica FX and an extended set of VMs.

Some Liberica JDK 21 distributions are also available with the following additional API and components:

  • Liberica JDK with CRaC
  • Liberica JDK with OpenWebStart

You can download Liberica from either the Liberica JDK Download Center or, as a support-plan customer, via a link on the support portal. On the Download Center page, scroll down and select the OS, package type, and the distribution variant (JDK/JRE). After the download completes, you can verify the downloaded file. You can also use the command line to download the installation packages, as described below.

The Linux package name for this release is bellsoft-java21. Liberica JDK is used in all examples below, but you can substitute it with Liberica JRE if necessary.

Pick your platform below — your choice is remembered as you scroll and when you switch Java versions.

Choose an installation method:

  1. Double-click the Windows installation file you downloaded to run the installer. This opens the Liberica JDK Setup Wizard.

  2. Click Next on the Welcome screen.

  3. In the Custom Setup window, choose the features you need. Select a feature to see its description. In most cases you can use the default setup. Click Disk Usage to see the available and required space on your disk. Click Next.

  4. The package is ready to install — press Install. If you see the User Account Control warning, verify the publisher (BELLSOFT) and click Yes.

  5. After the installation completes, click Finish to quit the Setup Wizard.

To install Liberica JDK silently without any user interaction, open the command line and run:

Terminal window
msiexec /i bellsoft-jdk21.0.6+10-windows-amd64.msi /qn /quiet /norestart /l*v "Liberica_install.log"

Where:

  • /i — install the specified software;
  • /qn — no UI;
  • /quiet — quiet mode without any user interaction;
  • /norestart — does not restart the computer after the installation is complete;
  • /l*v "Liberica_install.log" — verbose logging of all messages to the specified log file.

For the list of installation flags and options, run msiexec /help from the command line.

To specify the installation directory from the command line, use the INSTALLDIR property:

Terminal window
msiexec /i bellsoft-jdk21.0.6+10-windows-amd64.msi INSTALLDIR="C:\LibericaJDK\JDK21.0.6"

The Windows Installer provides several properties to directly control the features you install. The following are the most useful properties, listed in order of precedence:

PropertyDescription
ADDLOCALList of features to install
REMOVEList of features to uninstall
ADDDEFAULTList of features to set to their default state
REINSTALLList of features to repair

You can provide the list of features on the command line as follows:

Terminal window
msiexec /i bellsoft-jdk21.0.6+10-windows-amd64.msi ADDLOCAL=FeatureA1;FeatureB REMOVE=FeatureC ADDDEFAULT=FeatureD REINSTALL=FeatureE;FeatureF

You can also use the keyword ALL to indicate all features. For example, the following command installs all the features in the MSI package:

Terminal window
msiexec /i bellsoft-jdk21.0.6+10-windows-amd64.msi ADDLOCAL=ALL

Keep in mind that properties lower in the list overwrite the items higher in the list. Thus, in the following command, all the features are set to their default state:

Terminal window
msiexec /i bellsoft-jdk21.0.6+10-windows-amd64.msi ADDDEFAULT=ALL ADDLOCAL=FeatureA REMOVE=FeatureB

The order of the properties on the command line is irrelevant. Because ADDDEFAULT is later in the original list, it overwrites ADDLOCAL and REMOVE. The names of features are case sensitive — for example, FeatureA is different from featureA and Featurea.

Liberica JDK provides the following features that can be specified using the properties described above:

FeatureDescription
JavaWebStartInstall Liberica OpenWebStart
SetupPathAdd Liberica JDK runtime to PATH
SetupJavaHomePoint JAVA_HOME to Liberica JDK runtime
AssociateJarFilesAssociate .jar files with Liberica JDK runtime
CreateJavaSoftCreate JavaSoft registry keys

For the full list of configurable MSI CLI properties, see the Windows Installer Property Reference.

If your installation package includes OpenWebStart, you can configure the initial OpenWebStart proxy settings in the Installation Wizard. These settings can be changed later using the Liberica JDK OpenWebStart Control Panel, which you can launch either from the shortcut on the Windows Start Menu or by executing javaws-settings in the command line.

You can also specify default values for the proxy configuration on the command line during installation:

Terminal window
msiexec /i bellsoft-jdk21.0.6+10-windows-amd64-openwebstart.msi PROXYTYPE=0
OpenWebStart proxy command line properties
PropertyDescription
PROXYTYPEProxy type. Allowed values: 0 — no proxy; 1 — manual proxy configuration; 2 — automatic proxy configuration; 4 — use system proxy (the default value).
SAMEPROXYSet to true to use the same proxy for all protocols; set to false to use specific addresses for each protocol (HTTP, HTTPS, FTP, SOCKS). Default value is true.
PACURLURL address for automatic proxy configuration.
PROXYADDRESSAddress for the HTTP proxy; used for all protocols if SAMEPROXY=true.
PROXYPORTHTTP proxy port; used for all protocols if SAMEPROXY=true.
HTTPSPROXYADDRESSHTTPS proxy address.
HTTPSPROXYPORTHTTPS proxy port.
FTPPROXYADDRESSFTP proxy address.
FTPPROXYPORTFTP proxy port.
SOCKSPROXYADDRESSSOCKS proxy address.
SOCKSPROXYPORTSOCKS proxy port.

Open a command-line interface, such as PowerShell or cmd, and run:

Terminal window
java -version

You should see output similar to the following:

openjdk version "21.0.6" 2025-01-21 LTS
OpenJDK Runtime Environment (build 21.0.6+10-LTS)
OpenJDK 64-Bit Server VM (build 21.0.6+10-LTS, mixed mode, sharing)

Windows installer. If you installed Liberica JDK using a Windows installation file (.msi):

  1. From the Windows Control Panel, open Programs > Programs and Features and select the Liberica package you want to remove.
  2. Click Uninstall.

Standalone package. To uninstall a standalone Liberica JDK package, remove its directory and the related environment variables in the Environment Variables dialog box.

It is a good practice to verify the downloaded installation file by comparing its size on your drive to the size on the Downloads page.

A more advanced approach is to obtain the checksum of the downloaded file in a command-line interface and compare it to the one next to the Liberica JDK link on the Downloads page. Check the OS-specific commands below.

To get the checksum of the downloaded file, run the following command in Windows PowerShell. To run PowerShell, open the Start menu or press Windows key + R, type powershell in the Run dialog box, and click OK.

Terminal window
(Get-FileHash .\bellsoft-jdk21.0.6+10-windows-amd64.msi -Algorithm SHA1).Hash

This section provides instructions to resolve some of the most common installation issues.

The JDK code can run on a number of platforms, using different compilers and build tools. We recommend checking your system compatibility on the Supported System Configurations page before installing the Liberica product.

Issues below are grouped by platform — the tab matches the OS you selected above.

To ensure the security of the user’s computer, Microsoft Defender SmartScreen sometimes prevents running downloaded files and triggers warnings while installing software. If SmartScreen prevents installing the Liberica product, follow these steps:

  1. Verify the downloaded Liberica installation file as described in Verifying downloaded files.
  2. Ensure that the installation file is signed by BELLSOFT by checking the details of the Digital Signatures in the Liberica installation file Properties.
  3. Depending on the verification results:
    • If the size and checksum of the downloaded file match those on the Downloads page and the file is signed by BELLSOFT, click More info on the Microsoft Defender SmartScreen window and then click Run anyway.
    • If any of the verified information is not correct, delete the file and download the Liberica installation file again.

If your browser prevents saving the downloaded Liberica installation file, click the Downloads icon and either click Keep or click More actions next to the downloaded file and, depending on the browser, select Keep or Download to save the file.

If after running a silent installation the software is not installed, check your log file for error messages. If the issue is the lack of administrator rights of the account running the installation, the log should contain a message similar to the following:

Error 1925. You do not have sufficient privileges to complete this installation for all users of the machine. Log on as administrator and then retry this installation.

Make sure you use an administrator account for running silent installation.

Reverting to a previous Liberica product version on Windows

Section titled “Reverting to a previous Liberica product version on Windows”

If you have the latest version of a Liberica product installed and need to install a previous version of exactly the same product, first uninstall the current version and then install the version you need.