Skip to content

Updating to Adoptium

Dave N edited this page Jun 22, 2024 · 15 revisions

First, We must specify two things: Today's date is 31-May-2024, and our current supported Java version(s) are specified here.

Our current recommended version of Java is Adoptium Java 17 - LTS.


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


INSTALLATION: The Steps below need to be followed EXACTLY!


  1. Uninstall Your Current Java Install:

Uninstalling Java on Windows

  1. Open Control Panel:

    • Press Windows + R, type control, and press Enter.
  2. Go to Programs:

    • Click on "Programs" or "Programs and Features".
  3. Uninstall Java:

    • Find "Java" in the list of installed programs.
    • Select it and click on "Uninstall".
    • Follow the prompts to complete the uninstallation.

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:

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.

image

  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, Zip would need to be unzipped and then installed.


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

  1. (CRITICAL STEP) Custom Setup:

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


TROUBLESHOOTING AND TESTING


For detailed help you'll need to join our Discord. Before you do having these tests run will help us out.

Checking the Java Version via Command Line on Windows, Mac, and Linux


Windows 10 and 11

To check the installed Java version on Windows 10 or 11, you can use the Command Prompt. Follow these steps:

  1. Open Command Prompt:

    • Press Windows + R to open the Run dialog box.
    • Type cmd and press Enter, or click OK.
  2. 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.
  3. Verify JAVA_HOME:

    • To check if the JAVA_HOME environment variable is set, type the following command and press Enter:
      echo %JAVA_HOME%
    • This command will display the path set for JAVA_HOME. If JAVA_HOME is not set, you will see an empty line or an error message.

Mac

To check the installed Java version on a Mac, you can use the Terminal. Follow these steps:

  1. Open Terminal:

    • Press Command + Space to open Spotlight Search.
    • Type Terminal and press Enter.
  2. 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.
  3. Verify JAVA_HOME:

    • To check if the JAVA_HOME environment variable is set, type the following command and press Enter:
      echo $JAVA_HOME
    • This command will display the path set for JAVA_HOME. If JAVA_HOME is not set, you will see an empty line or an error message.

Linux

To check the installed Java version on a Linux system, you can use the Terminal. Follow these steps:

  1. Open Terminal:

    • This can usually be done by pressing Ctrl + Alt + T or by searching for Terminal in your applications menu.
  2. 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.
  3. Verify JAVA_HOME:

    • To check if the JAVA_HOME environment variable is set, type the following command and press Enter:
      echo $JAVA_HOME
    • This command will display the path set for JAVA_HOME. If JAVA_HOME is not set, you will see an empty line or an error message.
Clone this wiki locally