Last Updated:
Liberica JDK 24 Download: A Comprehensive Guide to Installation and Usage
In the ever-evolving landscape of Java development, choosing the right JDK (Java Development Kit) is critical for performance, security, and compatibility. Liberica JDK, developed by BellSoft, has emerged as a leading OpenJDK distribution, renowned for its cross-platform support, long-term maintenance, and inclusion of optional components like JavaFX (via LibericaFX) and Native Image Kit (NIK). With the release of Liberica JDK 24, developers gain access to the latest Java 24 features, enhanced security, and optimizations.
This blog provides a detailed, step-by-step guide to downloading, installing, and using Liberica JDK 24. Whether you’re a seasoned developer or new to Java, you’ll find everything you need to get started, including system requirements, installation walkthroughs for major operating systems, best practices, and troubleshooting tips.
Table of Contents#
- What is Liberica JDK 24?
- Key Features of JDK 24
- Prerequisites for Installation
- Downloading Liberica JDK 24
- Installation Guide by Operating System
- Verifying the Installation
- Best Practices for Using Liberica JDK 24
- Example Usage: Compiling and Running a Java Program
- Troubleshooting Common Issues
- Conclusion
- References
What is Liberica JDK 24?#
Liberica JDK 24 is a production-ready, open-source distribution of OpenJDK 24, the reference implementation of Java SE 24. Developed by BellSoft, it is fully compliant with the Java SE specification and includes:
- Cross-platform support: Available for Windows, macOS, Linux, and even embedded systems (e.g., ARM, PowerPC).
- Optional components: Pre-bundled LibericaFX (JavaFX) for GUI development and Liberica NIK (Native Image Kit) for compiling Java apps to native executables.
- Long-term support (LTS): BellSoft offers commercial support for Liberica JDK 24 (if designated as an LTS release) under its Liberica Extended Support (LES) program.
- Security updates: Regular patches for vulnerabilities, ensuring compliance with industry standards.
Liberica JDK 24 is ideal for enterprise applications, cloud services, and desktop/mobile development, thanks to its stability and broad compatibility.
Key Features of JDK 24#
Liberica JDK 24 inherits all features from OpenJDK 24, which focuses on language enhancements, performance improvements, and modernization. Key JEPs (JDK Enhancement Proposals) include:
1. JEP 467: Markdown Documentation Comments#
Allows JavaDoc comments to use Markdown syntax (e.g., *bold*, [links]), making documentation more readable and expressive.
2. JEP 476: Module Import Declarations#
Simplifies module dependencies with import module statements, reducing boilerplate in module-info.java.
3. JEP 485: Stream Gatherers#
Adds a new Stream Gatherer API that enables custom intermediate operations, making stream pipelines more composable and expressive.
4. JEP 480: Foreign Function & Memory API (Third Preview)#
Improves interoperability with native code (C/C++) by simplifying memory management and function calls.
5. Performance Optimizations#
- Enhanced G1 garbage collector with reduced pause times.
- Improved JIT compiler (GraalVM) for faster startup and peak performance.
Prerequisites for Installation#
Before downloading Liberica JDK 24, ensure your system meets the following requirements:
| Operating System | Minimum Version | Architecture | RAM | Disk Space |
|---|---|---|---|---|
| Windows | Windows 10 (64-bit) or 11 | x86_64, AArch64 (ARM) | 2 GB+ | 100 MB+ |
| macOS | macOS 12 (Monterey) | x86_64, AArch64 (M1/M2) | 2 GB+ | 100 MB+ |
| Linux | Ubuntu 20.04, RHEL 8 | x86_64, AArch64, s390x | 2 GB+ | 100 MB+ |
- 64-bit architecture is required (32-bit support is deprecated in modern JDKs).
- For Linux, ensure
libc6(glibc) version 2.31+ is installed (check withldd --version).
Downloading Liberica JDK 24#
Liberica JDK 24 is available for free from BellSoft’s official website. Follow these steps to download the correct package:
Step 1: Visit the BellSoft Liberica JDK Page#
Go to https://bell-sw.com/pages/downloads/.
Step 2: Select JDK Version#
- From the "Version" dropdown, select 24.
- Choose the release type:
- LTS: For long-term support (if 24 is an LTS release).
- Non-LTS: For the latest features (shorter support cycle).
Step 3: Choose Your Platform#
Select your operating system (Windows, macOS, Linux) and architecture (e.g., x86_64 for Intel/AMD, AArch64 for ARM).
Step 4: Select Package Type#
Liberica offers multiple package formats for flexibility:
| OS | Package Types |
|---|---|
| Windows | MSI Installer, ZIP Archive |
| macOS | DMG Installer, TAR.GZ Archive, Homebrew Cask |
| Linux | DEB (Debian/Ubuntu), RPM (RHEL/CentOS), TAR.GZ Archive, Docker Image |
- For GUI installation: Choose MSI (Windows), DMG (macOS), DEB/RPM (Linux).
- For manual setup: Choose ZIP/TAR.GZ.
- For JavaFX apps: Select "LibericaFX" (includes JavaFX runtime).
Step 5: Download and Verify the Checksum#
-
Click "Download" to save the file.
-
Critical: Verify the SHA-256 checksum to ensure the file is not corrupted or tampered with. BellSoft provides checksums on the download page.
Example (Linux TAR.GZ):
# Replace <file> with your downloaded filename sha256sum <file>.tar.gzCompare the output with the checksum on the BellSoft website.
Installation Guide by Operating System#
Windows#
Option 1: MSI Installer (Recommended for Most Users)#
- Double-click the downloaded
.msifile. - In the installer wizard:
- Accept the license agreement.
- Choose the installation directory (default:
C:\Program Files\BellSoft\LibericaJDK-24). - Check "Set JAVA_HOME variable" and "Add to PATH" (recommended for command-line access).
- Click "Install" and wait for completion.
Option 2: ZIP Archive (Manual Setup)#
- Extract the ZIP file to a directory (e.g.,
C:\Java\LibericaJDK-24). - Set
JAVA_HOMEandPATHenvironment variables:- Open System Properties > Advanced > Environment Variables.
- Under "System Variables", click "New" and add:
- Variable name:
JAVA_HOME - Variable value:
C:\Java\LibericaJDK-24(path to your extracted folder).
- Variable name:
- Edit the
PATHvariable and add%JAVA_HOME%\bin.
- Restart your command prompt to apply changes.
macOS#
Option 1: DMG Installer#
- Double-click the
.dmgfile to mount the disk image. - Drag the
LibericaJDK24folder toApplications. - Set
JAVA_HOME(required for command-line use):- Open Terminal and run:
echo 'export JAVA_HOME=/Applications/LibericaJDK24.jdk/Contents/Home' >> ~/.zshrc # For Zsh # OR for Bash: echo 'export JAVA_HOME=/Applications/LibericaJDK24.jdk/Contents/Home' >> ~/.bash_profile - Restart Terminal or run
source ~/.zshrcto apply.
- Open Terminal and run:
Option 2: Homebrew Cask (For CLI Users)#
If you use Homebrew, install Liberica JDK 24 with:
brew install bellsoft-liberica-jdk24 Homebrew automatically sets JAVA_HOME and updates PATH.
Linux (Debian/Ubuntu, RHEL/CentOS)#
Debian/Ubuntu (DEB Package)#
- Download the
.debfile. - Install with
dpkg:sudo dpkg -i liberica-jdk24-<version>-linux-amd64.deb - Verify installation (no need to set
PATHmanually—DEB packages handle this).
RHEL/CentOS (RPM Package)#
- Download the
.rpmfile. - Install with
rpm:sudo rpm -ivh liberica-jdk24-<version>-linux-amd64.rpm
TAR.GZ Archive (Manual Setup)#
- Extract the TAR.GZ file to
/usr/lib/jvm(common location):sudo tar -xzf liberica-jdk24-<version>-linux-amd64.tar.gz -C /usr/lib/jvm - Set
JAVA_HOMEandPATH:echo 'export JAVA_HOME=/usr/lib/jvm/liberica-jdk24-<version>' >> ~/.bashrc echo 'export PATH=$JAVA_HOME/bin:$PATH' >> ~/.bashrc source ~/.bashrc
Verifying the Installation#
After installation, confirm Liberica JDK 24 is correctly set up:
-
Open a terminal/command prompt.
-
Run:
java -versionExpected Output:
openjdk version "24" 2024-03-19 OpenJDK Runtime Environment (build 24+36-LTS) OpenJDK 64-Bit Server VM (build 24+36-LTS, mixed mode, sharing)(The "Liberica" branding may appear in the output, depending on the build.)
-
Verify the compiler:
javac -versionExpected Output:
javac 24
Best Practices for Using Liberica JDK 24#
To maximize productivity and avoid issues, follow these best practices:
1. Use the Correct Architecture#
Ensure you download the JDK for your system’s architecture (x86_64 vs. AArch64). Mismatched architectures cause "file not found" or "invalid executable" errors.
2. Manage Multiple JDKs with jEnv (Optional)#
If you use multiple JDK versions, tools like jEnv (for Linux/macOS) or SDKMAN! simplify switching:
# Install jEnv (macOS/Linux)
git clone https://github.com/jenv/jenv.git ~/.jenv
echo 'export PATH="$HOME/.jenv/bin:$PATH"' >> ~/.bashrc
echo 'eval "$(jenv init -)"' >> ~/.bashrc
source ~/.bashrc
# Add Liberica JDK 24 to jEnv
jenv add /usr/lib/jvm/liberica-jdk24-<version>
jenv global 24 # Set as default 3. Keep JDK Updated#
BellSoft releases security patches for Liberica JDK. Check for updates via:
- Windows/macOS: BellSoft’s download page.
- Linux:
sudo apt update && sudo apt upgrade(DEB) orsudo yum update(RPM).
4. Use LibericaFX for JavaFX Apps#
If developing GUI apps, download the "LibericaFX" variant to avoid missing javafx.* classes.
5. Verify Checksums#
Always verify the SHA-256 checksum of downloaded files to prevent malware or corruption.
Example Usage: Compiling and Running a Java Program#
Let’s test Liberica JDK 24 with a simple "Hello World" program that uses JDK 24’s Markdown documentation (JEP 467):
Step 1: Create a Java File#
Create HelloJDK24.java with:
/**
* # Hello JDK 24!
* This program demonstrates **Markdown documentation** (JEP 467) and
* runs on Liberica JDK 24.
*/
public class HelloJDK24 {
public static void main(String[] args) {
System.out.println("Hello, Liberica JDK 24! 🚀");
}
} Step 2: Compile the Program#
Run:
javac HelloJDK24.java Step 3: Run the Program#
java HelloJDK24 Output:
Hello, Liberica JDK 24! 🚀
Step 4: Generate JavaDoc (with Markdown)#
To see JEP 467 in action, generate JavaDoc:
javadoc HelloJDK24.java -d docs Open docs/HelloJDK24.html in a browser—the Markdown (#, **) will render as formatted text.
Troubleshooting Common Issues#
1. "java: command not found"#
- Cause:
PATHvariable not set correctly. - Fix:
- Windows: Reinstall with "Add to PATH" checked, or manually edit
PATHto include%JAVA_HOME%\bin. - Linux/macOS: Ensure
JAVA_HOME/binis inPATH(runecho $PATHto verify).
- Windows: Reinstall with "Add to PATH" checked, or manually edit
2. Version Mismatch (e.g., "openjdk version 17" instead of 24)#
- Cause: Another JDK is prioritized in
PATH. - Fix: Use
jEnvto set Liberica JDK 24 as global, or adjustPATHto listJAVA_HOME/binfirst.
3. Checksum Mismatch#
- Cause: Corrupted download or tampered file.
- Fix: Redownload the JDK from BellSoft’s official site and re-verify the checksum.
4. "Unsupported OS/Architecture"#
- Cause: Downloaded JDK for the wrong OS/architecture (e.g., x86_64 on ARM macOS).
- Fix: Re-download the correct package for your system.
Conclusion#
Liberica JDK 24 is a robust, feature-rich OpenJDK distribution that empowers developers with the latest Java 24 capabilities. By following this guide, you can easily download, install, and configure Liberica JDK 24 on Windows, macOS, or Linux. Remember to adhere to best practices like verifying checksums, managing multiple JDKs, and keeping the JDK updated to ensure a secure and efficient development environment.
Whether you’re building enterprise applications, cloud services, or desktop apps, Liberica JDK 24 provides the stability and performance needed to succeed.