Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Some links on this page are affiliate links: if you buy through them we may earn a commission, at no extra cost to you.

Install JDK 20 only if a project specifically requires it. Java 20 is an archived release; Oracle warns that archived versions do not receive the latest security patches and recommends a current JDK for production. If you need Java 20 for compatibility, download JDK 20.0.2 from the Oracle Java SE 20 archive, choose the package matching your operating system and processor, then verify both java and javac.

These steps use Oracle JDK 20 unless noted. An installer is simplest for most desktop users; an archive is useful for portable or side-by-side installations.

Before you install: make sure you need JDK 20

The JDK, or Java Development Kit, includes tools for developing and compiling Java applications. The java command launches Java programs; javac compiles Java source files. The JVM (Java Virtual Machine) executes compiled Java bytecode. A runtime may be enough to run some applications, but if you need to compile code, use javac, or develop with an IDE or build tool, install a JDK.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Use JDK 20 when a project, course, build, test environment, or compatibility requirement specifically calls for Java 20. For new development or production systems, choose a currently supported JDK instead. Oracle’s archive page lists JDK 20.0.2 and cautions that archived releases lack the latest security updates.

#1 Best Overall

Choose a JDK distribution and download

This guide’s platform-specific steps assume Oracle JDK 20.0.2. The Oracle archive provides Windows x64 installers and a ZIP archive; macOS installers for Intel x64 and Apple-silicon AArch64; and Linux packages or archives for x64 and AArch64. Select the JDK—not a JRE—and match the operating system and processor architecture. Most Windows PCs use x64; Intel Macs use x64 and Apple-silicon Macs use AArch64/ARM64. Linux users should check their system architecture before downloading.

Oracle JDK, OpenJDK builds, and Eclipse Temurin are distinct vendor distributions. They implement the same Java platform release and are generally intended to be compatible, but packaging, licensing, support, and update policies differ. If your project requires a specific vendor, follow that requirement. For an upstream OpenJDK overview, see OpenJDK’s installation page. Temurin installation options are documented at Adoptium; check that the chosen vendor still offers a Java 20 build before relying on a version-specific download.

Oracle provides SHA-256 links beside archived downloads. For an old binary, compare the downloaded file against the vendor-provided checksum before installing it; do not use a file whose checksum does not match.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Install JDK 20 on Windows

Using the installer

  1. Open the Java SE 20 archive and download the Windows x64 .exe installer. The archive also offers an .msi, often useful for managed deployment, and a portable .zip.
  2. Run the installer and follow its prompts. Keep the default location unless your organization requires another one.
  3. Close and reopen Command Prompt or PowerShell, then check java -version and javac -version.

Some installers may make Java commands available automatically. If the commands are missing or another version is selected, configure the environment variables. Set JAVA_HOME to the JDK’s installation directory, for example:

JAVA_HOME=C:Program FilesJavajdk-20

The actual directory may differ; use the one created by your installer. In Windows, open System Properties > Advanced > Environment Variables. Create or edit JAVA_HOME, then add %JAVA_HOME%bin to Path. JAVA_HOME points to the JDK directory, not its bin folder. Open a new terminal after changing variables.

Using the ZIP archive

Extract the downloaded archive to a location you control, such as C:Java. In PowerShell, with the archive in the current directory:

Expand-Archive -Path .jdk-20_windows-x64_bin.zip -DestinationPath C:Java

Set JAVA_HOME to the extracted JDK directory (for example, C:Javajdk-20, depending on the folder actually extracted) and add %JAVA_HOME%bin to Path. Oracle’s archive contains versioned filenames; check the downloaded filename and extracted folder rather than assuming they match the example exactly.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #2
Dell Latitude 3190 11.6" HD 2-in-1 Touchscreen Laptop Intel N5030 1.1Ghz 4GB Ram 128GB SSD Windows 11 Professional (Renewed)
  • 1.1 GHz (boost up to 2.4GHz) Intel Celeron N5030 Quad-Core
  • 4GB DDR4 System Memory; 128GB Solid State Drive
  • 11.6" HD (1366 x 768) Multi-Touch Display
  • Combo headphone/microphone jack - Noble Wedge Lock slot - HDMI; 2 USB 3.1 Gen 1
  • Windows 11 Pro

To diagnose command selection in PowerShell, run:

where.exe java
where.exe javac
java -version
javac -version
$env:JAVA_HOME

In Command Prompt, use where java, where javac, and echo %JAVA_HOME%. If the listed executable is from an older JDK, move JDK 20’s bin entry earlier in Path or remove stale Java entries. Check both user and system variables. Avoid repeatedly rebuilding Path with setx; editing Environment Variables directly is safer than risking an unwieldy or truncated value.

Install JDK 20 on macOS

Choose the correct installer

  • Intel Mac: jdk-20_macos-x64_bin.dmg.
  • Apple-silicon Mac: jdk-20_macos-aarch64_bin.dmg.

Download the matching disk image from Oracle’s Java 20 archive. Double-click the .dmg, open the .pkg inside, and follow the installer prompts. Then open Terminal and run:

java -version
javac -version

The version-specific JDK 20 installation guide describes the macOS installation process and JDK selection.

Select JDK 20 when other JDKs are installed

List macOS-recognized JDKs with:

/usr/libexec/java_home -V

To run the Java 20 compiler explicitly:

/usr/libexec/java_home -v 20 --exec javac -version

To select it for the current shell session:

export JAVA_HOME=$(/usr/libexec/java_home -v 20)
export PATH="$JAVA_HOME/bin:$PATH"

For Zsh, make that selection persist by adding the lines to ~/.zshrc and reloading it:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
echo 'export JAVA_HOME=$(/usr/libexec/java_home -v 20)' >> ~/.zshrc
echo 'export PATH="$JAVA_HOME/bin:$PATH"' >> ~/.zshrc
source ~/.zshrc

If java_home -v 20 cannot find the JDK, check the list from java_home -V. A manually extracted archive may not be registered with macOS; for that case, set JAVA_HOME directly to the archive’s Contents/Home directory.

A macOS .tar.gz archive is not laid out like a generic Linux archive: the JDK executables are under Contents/Home. For most desktop installations, the DMG installer is the simpler choice.

Install JDK 20 on Linux

Oracle’s archive offers Linux x64 and AArch64 builds in Debian package (.deb), RPM package (.rpm), and generic .tar.gz formats. Match the package to both your distribution and processor. System package installation generally requires administrator access; an archive can instead be placed in a directory you own. Oracle’s Linux installation documentation explains the distinction between system packages and archives; its package examples are not a universal command set for every distribution.

Rank #3
Dell Latitude 5420 14" FHD Business Laptop Computer, Intel Quad-Core i5-1145G7, 16GB DDR4 RAM, 256GB SSD, Camera, HDMI, Windows 11 Pro (Renewed)
  • 256 GB SSD of storage.
  • Multitasking is easy with 16GB of RAM
  • Equipped with a blazing fast Core i5 2.00 GHz processor.

Debian or Ubuntu with a .deb package

After downloading the correct architecture, install the package from its download directory:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
sudo dpkg -i ./jdk-20_linux-x64_bin.deb

Replace the filename if you downloaded the AArch64 package or a differently named file. If package dependencies need repair, run:

sudo apt-get -f install

RPM-based Linux

Install the matching RPM with the tool supported by your distribution. The lower-level Oracle example is:

sudo rpm -ivh ./jdk-20_linux-x64_bin.rpm

On a system that uses DNF, a local package can instead be installed with sudo dnf install ./jdk-20_linux-x64_bin.rpm. Some older systems use YUM, for example sudo yum localinstall ./jdk-20_linux-x64_bin.rpm. These tools and commands are distribution-dependent; substitute the actual downloaded filename and architecture.

Generic Linux archive

Extract the archive, then move or keep the resulting JDK directory where you want it. For a shared location such as /opt/java:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
tar -xzf jdk-20_linux-x64_bin.tar.gz
sudo mkdir -p /opt/java
sudo mv jdk-20 /opt/java/

If the extracted directory has a different name, use that name in the move command. Set the environment for the current shell:

export JAVA_HOME=/opt/java/jdk-20
export PATH="$JAVA_HOME/bin:$PATH"

To make this persistent, add those export lines to ~/.bashrc for Bash or ~/.zshrc for Zsh, then source the relevant file or start a new shell. For a private installation without sudo, extract the archive in a user-owned directory and set JAVA_HOME to that location instead.

Rank #4
Sale
15.6 Inch Laptop Computer, N4020, 4GB DDR4 RAM, 128GB eMMC,with Windows 11
  • EFFORTLESS EVERYDAY PERFORMANCE: Powered by Intel Celeron N4020 processor and Windows 11 Home system, delivering reliable, low-power efficiency for daily tasks like document editing, email, online classes, and web browsing
  • 15.6-INCH FULL HD DISPLAY: Enjoy immersive visuals on the 15.6" FHD (1920x1080) anti-glare screen with micro-edge bezels. Delivers clear details and comfortable viewing for long study sessions, working on spreadsheets, and video playback
  • RESPONSIVE MULTITASKING & STORAGE: Built with 4GB LPDDR4 RAM and 128GB eMMC storage for smooth daily essential use. Expand your storage by up to 1TB via the integrated TF card slot to easily store movies, photos, and working files
  • ADVANCED CONNECTIVITY: Outfitted with 2x Full-Featured Type-C ports for data transfer, fast charging, and dual-monitor output, alongside 2x USB 3.2 Gen1 ports and a 3.5mm audio jack for complete peripheral compatibility
  • LIGHTWEIGHT & SILENT OPERATION: Slim and portable for effortless travel or commuting. Features a 1MP HD webcam for remote meetings, 38Wh battery with 45W Type-C fast charging, and a fanless silent design for peaceful work environments.

Verify with java -version and javac -version. If several JDKs are managed by the distribution’s alternatives system, the selection commands may be sudo update-alternatives --config java and sudo update-alternatives --config javac; availability and setup vary by distribution.

Verify that both the runtime and compiler are JDK 20

Run these commands in a new terminal after installation:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
java -version
javac -version

Both should report version 20. Checking only java -version is not enough: a runtime may be on Path while the compiler is absent or supplied by another JDK.

For a practical compile-and-run check, create a file named Hello.java containing:

public class Hello {
    public static void main(String[] args) {
        System.out.println("JDK 20 is working");
    }
}

In the same directory, compile and run it:

javac Hello.java
java Hello

The expected output is:

JDK 20 is working

This confirms that the compiler and runtime are callable and can work together on a basic program.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Troubleshoot the most common problems

java works, but javac is missing

You may have installed only a runtime, or your Path may point to an older Java installation. Check both executables (where java and where javac on Windows; which java and which javac on macOS or Linux), confirm that JAVA_HOME points to a JDK, and ensure its bin directory is on Path.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

The terminal reports the wrong version

Another Java bin directory is probably earlier in Path. Locate the executable with where or which, put the JDK 20 bin directory first (or remove stale entries), open a new terminal, and run both version checks again. On macOS, /usr/libexec/java_home -V helps identify registered JDKs.

Best Value
Sale
15.6 Inch Win 11 Laptop Computer, N4020, 4GB DDR4 RAM, 128GB Storage
  • WINDOWS 11 | STABLE PERFORMANCE: Powered by Intel Celeron N4020 processor and Windows 11 system, this laptop delivers stable performance for everyday computing tasks. It supports web browsing, online learning, document editing, email communication, and basic office work with optimized power efficiency, providing a practical and reliable experience for essential daily use for daily use.
  • 15.6” FHD IPS DISPLAY: Features a 15.6-inch Full HD IPS display with narrow bezels, offering wider viewing angles and clearer image details compared to standard panels. The improved screen-to-body ratio enhances visual experience for study, reading, document work, and video playback, making it suitable for both productivity and entertainment use.
  • 4GB DDR4 + 128GB eMMC STORAGE: Equipped with 4GB DDR4 memory and 128GB eMMC storage for everyday basics such as browsing, documents, email, and online learning platforms. The built-in TF card slot supports storage expansion up to 1TB, giving you more flexibility for files, photos, videos, and daily documents. TF card not included.
  • CONNECTIVITY & PORTS: Includes 1× TF card slot, 2× USB 3.2 Gen1 ports, and 2× full-featured Type-C ports (USB 3.2 Gen1). The Type-C ports support data transfer, charging, and video output, enabling flexible connection with external devices such as monitors, storage, and peripherals for daily work and study use.
  • LIGHTWEIGHT DESIGN | ONLINE COMMUNICATION: Designed with a slim, portable profile, this laptop is easy to carry for school, commuting, and travel. A built-in 1MP front camera supports online classes, video meetings, remote communication, and everyday conferencing. The 3300mAh battery works with the low-power system design to support practical daily use, while thermal optimization helps maintain quieter operation during extended tasks.

JAVA_HOME is wrong

Set JAVA_HOME to the JDK root, not to bin. Then add $JAVA_HOME/bin on macOS/Linux or %JAVA_HOME%bin on Windows to Path. On macOS, a standard installed JDK home is under /Library/Java/JavaVirtualMachines/…/Contents/Home.

Architecture mismatch or permission error

Confirm that the package matches your operating system and processor: x64 for Intel/AMD 64-bit systems and AArch64 for 64-bit ARM. For system-wide Linux packages, use the appropriate administrator privileges. If you cannot or should not install system-wide, use an archive in a directory you own and configure its paths there.

An IDE or build still uses another JDK

A terminal’s JAVA_HOME does not automatically control every IDE, Maven or Gradle configuration, Docker image, CI runner, service, or account. Check the JDK configured in the specific IDE or build environment. For command-line builds, mvn -version and gradle -version report the Java runtime those tools are using.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Installer or archive?

For most personal computers, an installer or operating-system package is easier to set up, integrates better with system tools, and is simpler to uninstall. An archive is useful when you want a portable or isolated JDK, need several versions side by side, or do not have administrator access. Archives generally require manual JAVA_HOME and Path configuration, are not always registered with system JDK selectors, and leave update and cleanup management to you. Adoptium similarly recommends package-manager installation for most users and positions archives for custom environments; see its archive guidance.

Should you keep using JDK 20?

Keep it where a project genuinely depends on Java 20, especially for compatibility testing or maintaining an existing application. Otherwise, move to a currently supported release and keep it updated. JDK 20 is an archived release, not a current production recommendation; Oracle’s archive notice specifically warns that it does not include the latest security patches.

Frequently Asked Questions

Can JDK 20 coexist with another JDK?

Yes. Multiple JDKs can be installed, but you must select which one a terminal, IDE, build tool, or service uses. The selection can differ between those environments.

Why does my IDE use a different Java version from my terminal?

An IDE can have its own project SDK or runtime setting, and build tools or CI jobs can select a JDK independently of the terminal’s JAVA_HOME. Check the JDK configured for that specific project or environment.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

How do I uninstall JDK 20?

Use your operating system’s installed-app or package-management tools for an installer/package installation. For an archive installation, remove the extracted JDK directory and undo the JAVA_HOME and PATH entries you added.

Quick Recap

Bestseller No. 1
HP 14' HD Laptop, Windows 11, Intel Celeron Dual-Core Processor Up to 2.60GHz, 4GB RAM, 64GB SSD, Webcam, Dale Pink (Renewed)
HP 14" HD Laptop, Windows 11, Intel Celeron Dual-Core Processor Up to 2.60GHz, 4GB RAM, 64GB SSD, Webcam, Dale Pink (Renewed)
14" diagonal, 1366x768 resolution, HD BrightView LED, Glossy NON-TOUCH Display
$247.00
Bestseller No. 2
Dell Latitude 3190 11.6' HD 2-in-1 Touchscreen Laptop Intel N5030 1.1Ghz 4GB Ram 128GB SSD Windows 11 Professional (Renewed)
Dell Latitude 3190 11.6" HD 2-in-1 Touchscreen Laptop Intel N5030 1.1Ghz 4GB Ram 128GB SSD Windows 11 Professional (Renewed)
1.1 GHz (boost up to 2.4GHz) Intel Celeron N5030 Quad-Core; 4GB DDR4 System Memory; 128GB Solid State Drive
Bestseller No. 3
Dell Latitude 5420 14' FHD Business Laptop Computer, Intel Quad-Core i5-1145G7, 16GB DDR4 RAM, 256GB SSD, Camera, HDMI, Windows 11 Pro (Renewed)
Dell Latitude 5420 14" FHD Business Laptop Computer, Intel Quad-Core i5-1145G7, 16GB DDR4 RAM, 256GB SSD, Camera, HDMI, Windows 11 Pro (Renewed)
256 GB SSD of storage.; Multitasking is easy with 16GB of RAM; Equipped with a blazing fast Core i5 2.00 GHz processor.
$309.00

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.