Updating to Adoptium (Eclipse Temurin Open Source Java) - MegaMek/megamek GitHub Wiki
Last updated: May 2026
See also: Java and MegaMek for the full version compatibility matrix.
This guide walks you through installing Eclipse Temurin, the recommended Java distribution for MegaMek, MegaMekLab, and MekHQ.
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
| 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.
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.
-
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.
-
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"
- In the list of installed programs, look for entries related to Java. These could include:
-
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.
-
Click 'Uninstall':
- After selecting the Java program, click the "Uninstall" button or option.
-
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.
-
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.
-
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\JavaorC:\Program Files (x86)\Java. Delete these folders if you no longer need them.
- After uninstalling, you can manually check your system for any leftover Java folders or files, often found in locations like
-
Reboot after the Uninstall.
-
Open Terminal:
- Press
Command + Space, typeTerminal, and pressEnter.
- Press
-
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
- For JDK: Run
-
Open Terminal:
- Use your preferred method to open the terminal.
-
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-*
- For Debian-based systems (e.g., Ubuntu):
By following these steps, you can uninstall Java from your operating system.
- Reboot Your Machine: This ensures that all changes take effect properly.
- Go to:
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.
- Download for Your OS: Select and download the version appropriate for your operating system.
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.
- Run the Installer: Download and execute the installer file.
- (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
If you don't you'll likely get the following error:

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".

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

- Complete Installation: Click next to finish the install.
- 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.
For detailed help, join our Discord. Before you do, running these tests will help us diagnose your issue faster.
For the full guide, see: How to Check the Installed Java Version.
Quick reference:
- Press
Windows + R, typecmd, pressEnter. - Run:
java -version
- Verify
JAVA_HOMEis set:
echo %JAVA_HOME%
- Open Terminal (
Command + Space, typeTerminal, pressEnter). - Run:
java -version
- Verify
JAVA_HOMEis set:
echo $JAVA_HOME
- Open Terminal (
Ctrl + Alt + Tor via your applications menu). - Run:
java -version
- Verify
JAVA_HOMEis set:
echo $JAVA_HOME