Independent community project. Not affiliated with Mojang or Microsoft.

Complete Java setup guide

How to install Java for Minecraft on Windows, Linux and macOS

A complete and friendly guide to choosing, installing and checking the Java version required by Minecraft.

You do not need to become a developer to install Java. You only need the correct version for your Minecraft release, the right package for your computer and one final check in the terminal.

Choose the correct Java version

The safest choice comes from the metadata for the exact Minecraft version you want to run. This table is a practical starting point.

Minecraft versionJava versionWhat to choose
26.2Java 25Temurin 25 for the current official release
1.20.5 to 1.21.xJava 21Temurin 21
1.18 to 1.20.4Java 17Temurin 17
1.17.xJava 16Temurin 16 when this exact release needs it
1.16.5 and olderJava 8Temurin 8, with extra care for historical builds
01

Check whether you actually need a manual Java installation

Minecraft Free Launcher keeps Java inside its own game data folder and selects the required runtime automatically. Leave the Java field empty in Settings when you want this recommended behavior.

A manual installation is useful when another launcher asks for a Java path, when a mod loader needs Java, when you run a server or when you are diagnosing a particular runtime.

  1. Open a terminal

    Use Windows Terminal, Terminal on macOS or the terminal application provided by your Linux desktop.

    java -version
  2. Read the first line

    If the command prints a version, Java already exists. Compare that number with the table above before installing anything else.

  3. Identify the processor

    Choose x64 for most Intel and AMD computers. Choose AArch64 for Windows on ARM, Linux ARM64 or a Mac with Apple Silicon.

02

Download a trusted Java package

This guide uses Eclipse Temurin from the Adoptium project. Open the official Temurin download page and choose the Java number from the compatibility table.

Choose your operating system, your processor architecture and JDK. The JDK is larger than a minimal runtime, but it is widely compatible with launchers, mod installers and server tools.

  1. Choose the version

    Select 25, 21, 17, 16 or 8 according to the Minecraft release you intend to start.

  2. Choose the platform

    Use MSI for Windows, PKG for macOS and the package format recommended for your Linux distribution.

  3. Check the architecture

    Do not install an AArch64 package on an x64 computer or an x64 package on an ARM computer.

03

Install Java on Windows

The interactive MSI installer is the clearest route for Windows 10 and Windows 11. You need administrator approval because Java is installed for the computer.

  1. Open the MSI file

    Confirm that the publisher and download location are the ones you selected on Adoptium, then continue through the installer.

  2. Enable the useful options

    Keep the main feature enabled. Enable the PATH option and JAVA_HOME when the installer offers them.

  3. Finish and open a new terminal

    A terminal that was already open may not see the new PATH value. Close it and open another one.

    java -version
  4. Find the executable when needed

    The following command shows every Java executable currently found through PATH.

    where java
04

Install Java on macOS

Temurin provides a normal PKG installer for macOS. Apple Silicon computers need AArch64. Older Intel Macs need x64.

  1. Open the PKG package

    Read the license, choose the normal system disk and approve the installation with the macOS administrator password.

  2. Check the active Java version

    Open a new Terminal window and verify the number shown on the first line.

    java -version
  3. See every installed JDK

    macOS can keep several Java families at the same time. This command lists their versions and locations.

    /usr/libexec/java_home -V
  4. Get the path for Java 21

    Replace 21 with the number required by your Minecraft version.

    /usr/libexec/java_home -v 21
05

Install Java on Linux

The package manager keeps Java updates connected to the rest of the system. Configure the official Adoptium repository once, then install the Temurin package matching your game.

The examples below use Java 25. Replace 25 with 21, 17, 16 or 8 when the Minecraft version requires another runtime.

  1. Prepare Debian or Ubuntu

    Install the small tools needed to register the signed Adoptium repository.

    sudo apt install -y wget apt-transport-https gpg
  2. Install Temurin on Debian or Ubuntu

    After adding the official repository by following the linked Adoptium Linux instructions, refresh the package list and install the JDK.

    sudo apt update && sudo apt install temurin-25-jdk
  3. Install Temurin on Fedora or RHEL

    After adding the official Adoptium RPM repository, install the required JDK with dnf.

    sudo dnf install temurin-25-jdk
  4. Verify the selected runtime

    The version shown here must agree with the Minecraft compatibility table.

    java -version
06

Point a launcher to the correct Java executable

A global Java installation does not force every launcher to use it. A launcher can keep its own runtime or an explicit path in a profile.

In Minecraft Free Launcher, open Settings and use Browse beside Java only when you need a manual override. Leave the field empty to return to automatic selection.

  1. Find Java on Windows

    Select javaw.exe from the bin folder of the JDK version you installed.

    where javaw
  2. Find Java on Linux or macOS

    This prints the executable selected by the current shell.

    which java
  3. Test the same game release again

    Do not change Java, RAM, mods and the game version at the same time. One change makes the result understandable.

07

Keep several Java versions without confusion

Java 8, 17, 21 and 25 can coexist because each family uses a separate directory. You do not need to uninstall the runtime used by an older modpack just to test a current release.

Prefer a per profile Java path when you regularly switch between Minecraft generations. Change the global default only when you understand which other applications depend on it.

  1. Record the working path

    Keep the exact Java folder beside the name of the Minecraft profile that uses it.

  2. Update within the same family

    Security updates for Java 21 normally replace or supersede an older Java 21 update without changing the required major version.

08

Solve the most common Java errors

The wording of an error usually tells you whether Java is missing, too old, too new or built for the wrong processor. Read the first useful line before reinstalling anything.

  1. Command not found

    Open a new terminal. If the error remains, reinstall Java with PATH enabled or select the executable directly in the launcher.

  2. Unsupported class file version

    The selected Java is older than the program expects. Move to the major version requested by the game or mod loader.

  3. Could not create the Java Virtual Machine

    Remove custom arguments, reduce memory to a sensible value and verify that the launcher points to a 64 bit runtime on a 64 bit computer.

  4. Game closes immediately

    Test a clean vanilla profile with the matching Java version. Add mods again only after the clean profile starts.

Questions

Do I need Java before installing Minecraft Free Launcher?

No. The launcher obtains a matching private runtime automatically. Install Java manually only for another tool or a deliberate override.

Should I install JRE or JDK?

Minecraft only needs a runtime, but the Temurin JDK is a reliable choice when mod installers and server tools also need Java.

Can Java 25 run every old Minecraft version?

No. Older releases and mod loaders can require Java 21, 17, 16 or 8. Use the major version expected by that exact profile.

Can I have several Java versions installed?

Yes. Keep each major version and select its executable per launcher profile.

Primary sources

Retrieved 20 July 2026.