-
Notifications
You must be signed in to change notification settings - Fork 291
Updating to Adoptium (Eclipse Temurin Open Source Java)
First, We must specify two things: Today's date is 31-May-2024, and our current supported Java version(s) are specified here.
This guide is written to assist you in switching to the recommended version when using Adoptium. Adoptium offers a free, open-source alternative to Oracle Java, focusing on community collaboration and vendor neutrality. In contrast, Oracle Java provides enterprise-level support and proprietary features at a cost.
Why use Eclipse Temurin by Adoptium over Oracle, especially for a community open-source project like MegaMek?
Adoptium is ideal for community open-source projects like MegaMek because it:
- Is free to use, eliminating licensing costs.
- Is open-source, allowing the community to inspect, modify, and contribute to the code.
- Ensures vendor neutrality, preventing vendor lock-in and fostering a diverse, collaborative development environment.
- Offers high-quality, compatible Java runtimes maintained by a global community.
As of the date above we are recommending player use the 0.49.19.1-MILESTONE release with Java 17. But the Table is designed to help players determine the best Java for the version of the program they are using.
Program Version | Minimum Java Version Required | Java Version Recommended | Recommendation |
---|---|---|---|
0.49.7-MILESTONE | Java 11 | Java 11 | Upgrade to 0.49.19.1-MILESTONE and Java 17 |
0.49.11-Development or later | Java 11 | Java 17 | Upgrade to 0.49.19.1-MILESTONE and Java 17 |
0.49.19.1-MILESTONE | Java 11 | Java 17 | Current Recommended Version. Ensure you're running Java 17 |
0.48.0-Stable | Java 8 | Java 17 | No longer supported. Upgrade to 0.49.19.1-MILESTONE |
0.50.0-Development (Coming Soon) | Java 17 | Java 17 | This Development Cycle hasn't started yet |
Please note the Adoptium links default to 64 Bit, Java 17 JRE. If you make changes to the default choices its the players responsibility to understand what they are choosing. Our standard answer will always be to follow the install steps outlined below.
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\Java
orC:\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 17 which we are now recommending as the preferred Java version.
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 this doesn't work, return to step 1, and redo all steps and double check STEP 6!
You should now have the recommended Java version installed.
For detailed help you'll need to join our Discord. Before you do having these tests run will help us out.
To check the installed Java version on Windows 10 or 11, you can use the Command Prompt. Follow these steps:
-
Open Command Prompt:
- Press
Windows + R
to open the Run dialog box. - Type
cmd
and pressEnter
, or clickOK
.
- Press
-
Check the Java Version:
- In the Command Prompt window, type the following command and press
Enter
:java -version
- This command will display the currently installed Java version.
- In the Command Prompt window, type the following command and press
-
Verify JAVA_HOME:
- To check if the
JAVA_HOME
environment variable is set, type the following command and pressEnter
:echo %JAVA_HOME%
- This command will display the path set for
JAVA_HOME
. IfJAVA_HOME
is not set, you will see an empty line or an error message.
- To check if the
To check the installed Java version on a Mac, you can use the Terminal. Follow these steps:
-
Open Terminal:
- Press
Command + Space
to open Spotlight Search. - Type
Terminal
and pressEnter
.
- Press
-
Check the Java Version:
- In the Terminal window, type the following command and press
Enter
:java -version
- This command will display the currently installed Java version.
- In the Terminal window, type the following command and press
-
Verify JAVA_HOME:
- To check if the
JAVA_HOME
environment variable is set, type the following command and pressEnter
:echo $JAVA_HOME
- This command will display the path set for
JAVA_HOME
. IfJAVA_HOME
is not set, you will see an empty line or an error message.
- To check if the
To check the installed Java version on a Linux system, you can use the Terminal. Follow these steps:
-
Open Terminal:
- This can usually be done by pressing
Ctrl + Alt + T
or by searching forTerminal
in your applications menu.
- This can usually be done by pressing
-
Check the Java Version:
- In the Terminal window, type the following command and press
Enter
:java -version
- This command will display the currently installed Java version.
- In the Terminal window, type the following command and press
-
Verify JAVA_HOME:
- To check if the
JAVA_HOME
environment variable is set, type the following command and pressEnter
:echo $JAVA_HOME
- This command will display the path set for
JAVA_HOME
. IfJAVA_HOME
is not set, you will see an empty line or an error message.
- To check if the