Updating to Adoptium (Eclipse Temurin Open Source Java) - MegaMek/megamek GitHub Wiki

Updating to Adoptium (Eclipse Temurin Open Source Java)

Last updated: May 2026
See also: Java and MegaMek for the full version compatibility matrix.


Our Current Recommended Version

Eclipse Temurin Java 21 - LTS


This guide walks you through installing Eclipse Temurin, the recommended Java distribution for MegaMek, MegaMekLab, and MekHQ.

A Quick Clarification: Adoptium Temurin IS Java

Temurin is the free, open-source build of Java maintained by the Eclipse Foundation — the same OpenJDK source code as Oracle's commercial distribution, just without the licensing strings attached. When this guide says "install Java," we mean Temurin.

Why use Temurin over Oracle Java for a community open-source project like MegaMek?

  • Free to use — no licensing costs
  • Open source — the community can inspect, modify, and contribute to the code
  • Vendor neutral — no lock-in, no surprise license changes
  • Reliable — high-quality Java runtimes maintained by a global community

Which Version Should I Install?

MegaMek Version Required Java
0.50.x (current Milestone) Java 17 LTS or newer (Java 21 LTS recommended)
0.51.0+ (next major) Java 21 LTS

Recommendation: If your system supports it, install Java 21 LTS. It runs everything current and you'll be ready the moment 0.51.0 drops.

32-bit Windows users: You can't use Java 21 — it dropped 32-bit support entirely. Stay on Java 17 LTS, and note that you'll be limited to the 0.50.x line once 0.51.0 ships.

Java 25: Not officially supported yet. We're actively testing it. Stick with Java 21 LTS for now.

For more detail on version compatibility, see Java and MegaMek.


INSTALLATION: The Steps Below Need to Be Followed EXACTLY!


Video Tutorial

Before proceeding with the written instructions, you may find it helpful to watch this step-by-step video guide:

How to install Megamek & Java! Play Battletech online! by "The Many Voices"

This video covers the installation process for both MegaMek and Java, providing a visual guide to complement the written instructions below.


Uninstall the old Java versions.

Uninstalling Java on Windows

  1. Open the Programs and Features Settings:

    • On Windows, search for "Add or Remove Programs" in the Start menu search bar and click on the result that appears.
  2. Find Java Installations:

    • In the list of installed programs, look for entries related to Java. These could include:
      • Eclipse Temurin
      • Oracle JDK (Java Development Kit)
      • Oracle JRE (Java Runtime Environment)
      • OpenJDK
      • Amazon Corretto
      • Search for "JRE" or "JDK"
  3. Select the Java Version to Uninstall:

    • Click on the name of the Java version you want to uninstall. If you see multiple entries, select each one you wish to remove.
  4. Click 'Uninstall':

    • After selecting the Java program, click the "Uninstall" button or option.
  5. Follow the On-screen Prompts:

    • Follow the prompts to complete the uninstallation process. You may need to confirm the action and wait for the uninstallation to finish.
  6. Repeat for Other Java Versions:

    • If there are multiple Java versions or distributions installed, repeat steps 3-5 for each one you want to remove.
  7. Check for Leftover Files (Optional):

    • After uninstalling, you can manually check your system for any leftover Java folders or files, often found in locations like C:\Program Files\Java or C:\Program Files (x86)\Java. Delete these folders if you no longer need them.
  8. Reboot after the Uninstall.

Uninstalling Java on macOS

  1. Open Terminal:

    • Press Command + Space, type Terminal, and press Enter.
  2. Remove Java Versions:

    • For JDK: Run sudo rm -rf /Library/Java/JavaVirtualMachines/jdk<version>.jdk
    • For JRE: Run sudo rm -rf /Library/Internet\ Plug-Ins/JavaAppletPlugin.plugin
    • For Java Web Start: Run sudo rm -rf /Library/PreferencePanes/JavaControlPanel.prefPane

Uninstalling Java on Linux

  1. Open Terminal:

    • Use your preferred method to open the terminal.
  2. Remove Java:

    • For Debian-based systems (e.g., Ubuntu): sudo apt-get remove --purge openjdk*
    • For Red Hat-based systems (e.g., CentOS): sudo yum remove java-*
    • For systems using dnf (e.g., Fedora): sudo dnf remove java-*

By following these steps, you can uninstall Java from your operating system.


  1. Reboot Your Machine: This ensures that all changes take effect properly.

  1. Go to:

image

The link above is preset to pick the 64 bit JRE (what is needed for play) and Java 21 LTS, the recommended Java version.

32-bit Windows users: Use this Java 17 link instead. Java 21 has no 32-bit build.

You will need to use the dropdown highlighted in Yellow to choose your Operating System. We recommend leaving the other fields preselected unless you have specific needs.

  1. Download for Your OS: Select and download the version appropriate for your operating system.
image

Windows shown as an example. MSI is the installer file, don't grab the zip as the files manually installed and is NOT an installer.


  1. Run the Installer: Download and execute the installer file.

  1. (CRITICAL STEPS) Installation Scope and Custom Setup:

In the newer versions of Adoptium Java they are defaulting the installation scope to "Install just for you...". It's critical you select

"Install for all users of this machine"

image1

If you don't you'll likely get the following error:

image

When you get to the "CUSTOM SETUP" Screen, you need to change the bottom 2 (Set JAVA_HOME variable, and JavaSoft (Oracle) registration keys) to be installed. Click the drop-down and set to "Will be installed on local hard drive".

image

When done, it should look like this (Note the Red X in the first Pics are changed):

image


  1. Complete Installation: Click next to finish the install.

  1. Reboot Again: Reboot your machine to finalize the installation.

If something doesn't work, return to Step 1, redo all the steps, and double-check Step 6 in particular. That's where most installations go sideways.

You should now have the recommended Java version installed.


TROUBLESHOOTING AND TESTING

For detailed help, join our Discord. Before you do, running these tests will help us diagnose your issue faster.

Checking Your Installed Java Version

For the full guide, see: How to Check the Installed Java Version.

Quick reference:

Windows 10 and 11

  1. Press Windows + R, type cmd, press Enter.
  2. Run:
   java -version
  1. Verify JAVA_HOME is set:
   echo %JAVA_HOME%

Mac

  1. Open Terminal (Command + Space, type Terminal, press Enter).
  2. Run:
   java -version
  1. Verify JAVA_HOME is set:
   echo $JAVA_HOME

Linux

  1. Open Terminal (Ctrl + Alt + T or via your applications menu).
  2. Run:
   java -version
  1. Verify JAVA_HOME is set:
   echo $JAVA_HOME
⚠️ **GitHub.com Fallback** ⚠️