Steps for Windows Batch file based on ChatGPT feedback.
Install both versions of Java:
Download and install Java 8.
Download and install Java 11.
Set up environment variables:
Open the System Properties (right-click on My Computer/This PC, select Properties, then Advanced system settings).
Click on the Environment Variables button.
Under System variables, find the JAVA_HOME variable. If it doesn’t exist, create a new one.
Set the JAVA_HOME variable to the path of the Java version you want to use by default (e.g., C:\Program Files\Java\jdk1.8.0_xx for Java 8 or C:\Program Files\Java\jdk-11.x.x for Java 11).
Adjust the PATH variable:
In the Environment Variables window, find the Path variable under System variables and edit it.
Add the path to the bin directory of both Java versions (e.g., C:\Program Files\Java\jdk1.8.0_xx\bin and C:\Program Files\Java\jdk-11.x.x\bin).
Switching between versions:
You can create batch scripts to switch between Java versions. For example, create a set-java8.bat file with the following content:
BATCH FILE
@echo off
set JAVA_HOME=C:\Program Files\Java\jdk1.8.0_xx
set PATH=%JAVA_HOME%\bin;%PATH%
echo Switched to Java 8
Similarly, create a set-java11.bat file:
BATCH FILE
@echo off
set JAVA_HOME=C:\Program Files\Java\jdk-11.x.x
set PATH=%JAVA_HOME%\bin;%PATH%
echo Switched to Java 11
Run the appropriate batch file before starting Fumbbl or MegaMek to switch to the required Java version.
Replace C:\Program Files\Java\jdk1.8.0_xx and C:\Program Files\Java\jdk-11.x.x with the actual installation paths of your Java versions.