Introduction
This guide describes how to install the Liberica product 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 LibericaFX and an extended set of VMs including Minimal VM;
-
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 LibericaFX and an extended set of VMs including Minimal VM.
You can download Liberica from either the Liberica JDK Download Center or, as a support-plan customer, via a link on the support portal. After you log in to the support portal, you can see a direct link to the version of Liberica you requested under Technologies. If you use the Liberica Download Center page, scroll down and select the OS, package type, and the distribution variant (JDK/JRE). After the download is completed, you can verify the downloaded file by comparing its size on your drive to the size on the Downloads page.
You can also use the command line to download the necessary installation packages as described further in this document.
Choose the OS below for specific installation instructions. Note that Liberica JDK is used for all examples below, but you can substitute it with Liberica JRE if necessary.
Microsoft Windows
Installing Liberica JDK using Microsoft Windows Installer package
-
Double click the Windows installation file you downloaded to run the installer. This opens the Liberica JDK Setup Wizard.
-
Click ‘Next’ on the Welcome screen.
Figure 1. Welcome -
On the Custom Setup step, choose 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’.
Figure 2. Features -
The package is ready to install, press ‘Install’. After the installation is complete, click ‘Finish’ to quit the Liberica JDK Setup Wizard.
Figure 3. Install-
Note that the installer screens above may vary in different releases.
-
To verify your installation, open a command-line interface, such as Powershell and run the following command:
java -version
You should see an output similar to the following:
openjdk version "20" 2023-03-21
OpenJDK Runtime Environment (build 20+37)
OpenJDK 64-Bit Server VM (build 20+37, mixed mode, sharing)
Uninstalling Liberica JDK
If you installed Liberica JDK using Windows installation file (.msi), use Windows Settings to uninstall it as follows.
On Windows 10.
-
Open Start > Settings > Apps > Apps & features.
-
Find LibericaJDK in the list of installed apps.
-
Click More (the ellipsis) to the right of the LibericaJDK name and select Uninstall.
On Windows 11.
-
Open Start > Settings > Apps > Installed Apps.
-
Find LibericaJDK in the list of installed apps.
-
Click More (the ellipsis) to the right of the LibericaJDK name and select Uninstall.
Silent installation
If you want to install Liberica JDK silently without any user interaction, open the command line and run the following command:
msiexec /i /qn /quiet /norestart bellsoft-jdk20+37-windows-amd64.msi
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.
You can use this command to perform a batch installation of Liberica JDK
on your network computers. For example, the following code creates a
temporary folder on a remote computer (user_pc
), copies an
installation file from a local folder to the temporary folder on the
remote computer, starts the Liberica JDK installation in silent mode,
and removes the temporary folder.
mkdir \\user_pc\c$\Windows\Temp\bellsoft-jdk
xcopy D:\silent\jdk\bellsoft-jdk20+37-windows-amd64.msi \\user_pc\c$\Windows\Temp\bellsoft-jdk /s /e
psexec64 \\user_pc c:\Windows\system32\msiexec.exe /i c:\Windows\Temp\bellsoft-jdk\bellsoft-jdk20+37-windows-amd64.msi /qn /quiet /norestart
rmdir /s /q \\user_pc\c$\Windows\Temp\bellsoft-jdk
Note: psexec64 is a small utility program to run commands on a remote computer. It is a part of PsTools package.
The installer logs the installation messages that can help you
investigate any issues in the installation process. To specify logging
level, use the /l
flag with options.
For the list of installation flags and options, run msiexec /help
from the command line.
Installing and removing the standalone package on Microsoft Windows
-
To install Liberica JDK as a standalone package on your computer, download the .zip package file and unpack it to a folder. You can also use Windows PowerShell to download and unpack the zip file as follows:
(New-Object System.Net.WebClient).DownloadFile("https://download.bell-sw.com/java/20+37/bellsoft-jdk20+37-windows-amd64.zip", "liberica.zip") Expand-Archive liberica.zip -DestinationPath .
The commands above unpack Liberica JDK to the current directory.
-
Add
<Liberica installation dir>/bin
subdirectory to the $PATH environment variable.If you do not want to change your environment variable, include the path to the
<Liberica installation dir>/bin
subdirectory when running Liberica JDK as in the following example:C:/LibericaJDK20/bin/java -jar $your_app
You can also create a new environment variable (such as $LIBERICA_DIR) with a path to the
<Liberica installation dir>/bin
subdirectory and use it when running Liberica JDK as follows:$LIBERICA_DIR/bin/java -jar $your_app
To uninstall a standalone Liberica JDK package, remove its directory and related environmental variables.
Apple MacOS
Installing on Apple MacOS
To install Liberica JDK, perform the following.
-
Run the installer by double-clicking the
.dmg
file you downloaded. -
Double-click the Install Liberica JDK pkg icon to run the installation Wizard.
Figure 4. DMG content -
Click Continue on the Welcome screen.
Figure 5. Welcome screen -
Click ‘Install’ to proceed with the default location.
Figure 6. Installation Type screenOptionally, you can change the install location by clicking ‘Change Install Location’ on the Installation Type screen and selecting the location to install Liberica JDK.
Figure 7. Choose Install Location screenIf you chose to change the install location, select the destination drive and click ‘Continue’.
-
Confirm new software installation. The file copying starts immediately.
Figure 8. Security Warning screen -
Observe the installation progress.
Figure 9. Install in Progress screen -
Once the installation is complete, click ‘Close’ to quit the installation wizard.
Figure 10. Installation Success screen
Uninstalling Liberica
To uninstall Liberica JDK using the package installer, perform the following.
-
Run the installer by double-clicking the
.dmg
file you downloaded. -
Double-click the Uninstall Liberica.app icon.
-
Click ‘Continue’ on the Welcome screen.
-
Select the Liberica installation you want to remove and click ‘Continue’.
-
Provide authentication information if necessary and click OK. Once the uninstallation is complete, click ‘Exit’ to quit the wizard.
To uninstall Liberica application using the Terminal, do the following (assuming that you installed Liberica using the default location on the boot volume (/)).
-
To uninstall Liberica JRE, run the following commands in the terminal.
sudo pkgutil --volume / --forget com.bell-sw.liberica.jre.20 sudo rm -rf /Library/Java/JavaVirtualMachines/liberica-jre-20
-
To uninstall Liberica JDK, run the following commands in the terminal.
sudo pkgutil --volume / --forget com.bell-sw.liberica.jdk.20 sudo rm -rf /Library/Java/JavaVirtualMachines/liberica-jdk-20
Installing and removing standalone package on MacOS
To install Liberica JDK as a standalone package, download the .zip package and unpack it as in the following example.
wget https://download.bell-sw.com/java/20+37/bellsoft-jdk20+37-macos-amd64.zip
unzip bellsoft-jdk20+37-macos-amd64.zip
The commands above unpack Liberica JDK to the current directory.
Next add <Liberica installation dir>/bin
subdirectory to the $PATH
environment variable.
If you do not want to change your environment variable, include the path
to the <Liberica installation dir>/bin
subdirectory when running
Liberica JDK as in the following example.
/Library/Java/JavaVirtualMachines/liberica-jdk-20/bin/java -jar $your_app
You can also create a new environment variable (such as $LIBERICA_DIR)
with a path to the <Liberica installation dir>/bin
subdirectory and
use it when running Liberica JDK as follows.
$LIBERICA_DIR/bin/java -jar $your_app
To uninstall a standalone Liberica JDK package, remove its directory and change related environmental variables.
Linux
APT Repository (.deb-based Linux distributions)
To install Liberica JDK, perform the following.
-
Add BellSoft official GPG key and set up the repository.
wget -q -O - https://download.bell-sw.com/pki/GPG-KEY-bellsoft | sudo apt-key add - echo "deb [arch=amd64] https://apt.bell-sw.com/ stable main" | sudo tee /etc/apt/sources.list.d/bellsoft.list
Liberica JDK repositories contain all Linux architectures supported in the release: amd64, i386, arm64, armhf. If amd64 is not the target architecture, replace it in the command above with the required architecture.
-
Update repositories and install packages.
sudo apt-get update sudo apt-get install bellsoft-java20
The following packages are available:
-
bellsoft-java20 contains the full Liberica JDK, including JavaFX and a variety of JVMs for platforms which support it.
-
bellsoft-java20-lite includes Liberica JDK with compressed modules and Server VM, without any extra packages.
-
bellsoft-java20-full contains the full Liberica JDK, including JavaFX and a variety of JVMs for platforms which support it.
-
bellsoft-java20-runtime includes Liberica JRE with JavaFX.
YUM Repository (.rpm-based Linux Distributions)
To install Liberica JDK, perform the following.
-
Set up the repository.
echo | sudo tee /etc/yum.repos.d/bellsoft.repo > /dev/null << EOF [BellSoft] name=BellSoft Repository baseurl=https://yum.bell-sw.com enabled=1 gpgcheck=1 gpgkey=https://download.bell-sw.com/pki/GPG-KEY-bellsoft priority=1 EOF
Liberica JDK repositories contain all Linux architectures supported in the release.
-
Update repositories and install packages.
sudo yum update sudo yum install bellsoft-java20
The following packages are available:
-
bellsoft-java20 contains contains the the optimal build for most desktops/servers.
-
bellsoft-java20-lite includes Liberica JDK with compressed modules and Server VM, without any extra packages.
-
bellsoft-java20-full contains the full Liberica JDK, including JavaFX and a variety of JVMs for platforms which support it.
-
bellsoft-java20-runtime includes Liberica JRE only.
YaST/Zypper Repository (SUSE Linux)
To install Liberica JDK, perform the following.
-
Set up the repository.
echo | sudo tee /etc/zypp/repos.d/repo-bellsoft.repo > /dev/null << EOF [BellSoft] name=BellSoft Repository baseurl=https://yum.bell-sw.com enabled=1 gpgcheck=1 gpgkey=https://download.bell-sw.com/pki/GPG-KEY-bellsoft priority=1 EOF
-
Update repositories and install packages.
sudo zypper up sudo zypper in bellsoft-java20
The following packages are available:
-
bellsoft-java20 contains the the optimal build for most desktops/servers.
-
bellsoft-java20-lite includes Liberica JDK with compressed modules and Server VM, without any extra packages.
-
bellsoft-java20-full contains the full Liberica JDK, including JavaFX and a variety of JVMs for platforms which support it.
-
bellsoft-java20-runtime includes Liberica JRE only.
Alpine Linux Repository
To install Liberica JDK, perform the following.
-
Setup the repository.
echo "https://apk.bell-sw.com/main" | sudo tee -a /etc/apk/repositories sudo wget -P /etc/apk/keys/ https://apk.bell-sw.com/[email protected]
-
Install packages.
apk add bellsoft-java20
The following packages are available:
-
bellsoft-java20 contains the optimal build for most desktops/servers.
-
bellsoft-java20-lite includes Liberica JDK with compressed modules and Server VM, without any extra packages.
-
bellsoft-java20-runtime includes Liberica JRE only.
Installing Liberica JDK using manual RPM installation
-
Obtain BellSoft official GPG key and then import it as in the following example.
wget -q -O - https://download.bell-sw.com/pki/GPG-KEY-bellsoft sudo rpm --import GPG-KEY-bellsoft
-
Download a package and install it.
wget https://download.bell-sw.com/java/20+37/bellsoft-jdk20+37-linux-amd64.rpm sudo rpm --install bellsoft-jdk20+37-linux-amd64.rpm
Installing on Ubuntu and other DEB-based OS’s
To install Liberica JDK, download the .deb package and run the apt tool as follows.
wget https://download.bell-sw.com/java/20+37/bellsoft-jdk20+37-linux-amd64.deb
sudo apt install ./bellsoft-jdk20+37-linux-amd64.deb
The commands above install Liberica JDK 20 package.
To use Liberica JDK, run the following command.
java -jar $your_app
To uninstall Liberica JDK, run the following command.
sudo apt remove bellsoft-java20
Installing on Red Hat Linux and other RPM-based OS’s
To install Liberica JDK, download the .rpm package and run the rpm tool as in the following example.
wget https://download.bell-sw.com/java/20+37/bellsoft-jdk20+37-linux-amd64.rpm
sudo yum install ./bellsoft-jdk20+37-linux-amd64.rpm
The commands above install Liberica JDK 20 package.
To use Liberica JDK, run the following command.
java -jar $your_app
To uninstall Liberica JDK, run the following command.
sudo yum remove bellsoft-java20
Installing on Alpine Linux
To install Liberica JDK, download the .apk package and run the apk tool.
wget https://download.bell-sw.com/java/20+37/bellsoft-jdk20+37-linux-x64-musl.apk
sudo apk add --allow-untrusted ./bellsoft-jdk20+37-linux-x64-musl.apk
To uninstall Liberica JDK, run the following command.
sudo apk del bellsoft-java20
Installing standalone JDK package on GNU/Linux
To install Liberica JDK, download the .tar.gz package and unpack it as follows.
wget https://download.bell-sw.com/java/20+37/bellsoft-jdk20+37-linux-amd64.tar.gz
tar -zxvf bellsoft-jdk20+37-linux-amd64.tar.gz
The commands above unpack Liberica JDK to the current directory. Either
add the <Liberica installation dir>/bin
subdirectory to $PATH, or
set up the path to this directory as $LIBERICA_DIR environment variable
and run Liberica JDK as follows.
$LIBERICA_DIR/bin/java -jar $your_app
To uninstall Liberica JDK, remove its directory and related environmental variables.
Troubleshooting
This segment provides instructions to resolve some most common installation issues.
Checking system requirements
The JDK code can run on a number of platforms, using different compilers and build tools. We recommend checking your system compatibility and requirements on the Supported System Configurations page before installing Liberica product.
Microsoft Defender SmartScreen warnings
To ensure the security of the user’s computer, Microsoft Defender SmartScreen sometimes prevents saving the downloaded files and triggers warnings while installing software. If you encounter similar behavior, check the instructions below.
Downloading Liberica using Edge
If the Edge browser prevents saving the downloaded Liberica installation file, click More actions next to the downloaded file and select Keep to save the file.
Installing Liberica on Windows
If Microsoft Defender SmartScreen prevents installing the Liberica product and shows a message similar to the one below, follow the instructions in this section.
-
Verify the downloaded Liberica installation file as described in Verifying downloaded files.
-
Ensure that the installation file is signed by BellSoft by checking the details of the Digital Signatures in the Liberica installation file Properties.
-
Depending on the verification results, do the following:
-
If the size and checksum of the downloaded file matches 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.
-
Verifying downloaded files
If you get any errors during the installation, the first thing to do is 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 verify the checksum of the downloaded file in a command-line interface. Check the OS-specific commands below. The checksum must match the one you can find next to the Liberica JDK link on the Downloads page.
Windows
To get the checksum of the downloaded file in the command-line, run the following command in Windows PowerShell. To run PowerShell, open the Start menu or press the Windows key + R, type powershell in the Run dialog box, and click OK.
(Get-FileHash .\bellsoft-jdk20+37-windows-amd64.msi -Algorithm SHA1).Hash
Apple MacOS
To get the checksum of the downloaded file, use the following command:
shasum -a 1 bellsoft-jdk20+37-macos-amd64.dmg
Ubuntu
To get the checksum of the downloaded file, use the following command:
shasum -a 1 bellsoft-jdk20+37-linux-amd64.deb
Reverting to a previous Standard Liberica JDK version on Windows
Warning: We do not recommend installing previous versions of Liberica products, because they may contain security issues resolved in the latest release.
If you have the latest version of the Standard Liberica JDK installed and need to install some previous version of this product, first uninstall the current version and after that install the version you need.