Author Topic: Java Concerns (Split from Coming Soon)  (Read 172 times)

Wrangler

  • Colonel
  • *
  • Posts: 25155
  • Dang it!
    • Battletech Fanon Wiki
Java Concerns (Split from Coming Soon)
« on: 28 May 2024, 17:59:15 »
I wish the move away from Java 8 hadn't happened. It's causing me some problems. Other Javas aren't as capable and won't run other java based programs.



MOD Note
Split this as we want to keep discussions on Coming Soon limited to coming soon.
« Last Edit: 30 May 2024, 16:10:48 by Hammer »
"Men, fetch the Urbanmechs.  We have an interrogation to attend to." - jklantern
"How do you defeat a Dragau? Shoot the damn thing. Lots." - Jellico 
"No, it's a "Most Awesome Blues Brothers scene Reenactment EVER" waiting to happen." VotW Destrier - Weirdo  
"It's 200 LY to Sian, we got a full load of shells, a half a platoon of Grenadiers, it's exploding outside, and we're wearing flak jackets." VoTW Destrier - Misterpants
-Editor on Battletech Fanon Wiki

Hammer

  • Numerorum Malleo
  • Global Moderator
  • Major
  • *
  • Posts: 4191
    • MegaMek Website
Re: Re: Coming Soon to MegaMek
« Reply #1 on: 30 May 2024, 16:09:15 »
I wish the move away from Java 8 hadn't happened. It's causing me some problems. Other Javas aren't as capable and won't run other java based programs.

Java is backwards compatible, but some Java programs but a max Java version. You can run multiple versions of Java on a machine with batch files.
MegaMek Projects Wiki
Bug Trackers
MegaMek Tracker
MekHQ Tracker
MegaMekLab Tracker
New Units and RAT's aren't added until after the 2 month release moratorium is passed.
Join the official MegaMek Discord

Hammer

  • Numerorum Malleo
  • Global Moderator
  • Major
  • *
  • Posts: 4191
    • MegaMek Website
Re: Java Concerns (Split from Coming Soon)
« Reply #2 on: 30 May 2024, 16:14:56 »
Steps for Windows Batch file based on ChatGPT feedback.

Code: [Select]
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.
MegaMek Projects Wiki
Bug Trackers
MegaMek Tracker
MekHQ Tracker
MegaMekLab Tracker
New Units and RAT's aren't added until after the 2 month release moratorium is passed.
Join the official MegaMek Discord

Wrangler

  • Colonel
  • *
  • Posts: 25155
  • Dang it!
    • Battletech Fanon Wiki
Re: Java Concerns (Split from Coming Soon)
« Reply #3 on: Today at 07:34:38 »
This is in the main drive where operating system is based in?
"Men, fetch the Urbanmechs.  We have an interrogation to attend to." - jklantern
"How do you defeat a Dragau? Shoot the damn thing. Lots." - Jellico 
"No, it's a "Most Awesome Blues Brothers scene Reenactment EVER" waiting to happen." VotW Destrier - Weirdo  
"It's 200 LY to Sian, we got a full load of shells, a half a platoon of Grenadiers, it's exploding outside, and we're wearing flak jackets." VoTW Destrier - Misterpants
-Editor on Battletech Fanon Wiki

Hammer

  • Numerorum Malleo
  • Global Moderator
  • Major
  • *
  • Posts: 4191
    • MegaMek Website
Re: Java Concerns (Split from Coming Soon)
« Reply #4 on: Today at 09:34:01 »
I'm going to post better more specific instructions later.
« Last Edit: Today at 13:46:58 by Hammer »
MegaMek Projects Wiki
Bug Trackers
MegaMek Tracker
MekHQ Tracker
MegaMekLab Tracker
New Units and RAT's aren't added until after the 2 month release moratorium is passed.
Join the official MegaMek Discord

Rebel Yell

  • Master Sergeant
  • *
  • Posts: 275
Re: Java Concerns (Split from Coming Soon)
« Reply #5 on: Today at 11:41:39 »
I'm going to posted better more specific instructions later.

Hopefully, they'll be better than that sentence.

Sorry, couldn't resist.  :grin:
3025-3039 The Glory days of BT. Everything after that can get off my lawn.

Wrangler

  • Colonel
  • *
  • Posts: 25155
  • Dang it!
    • Battletech Fanon Wiki
Re: Java Concerns (Split from Coming Soon)
« Reply #6 on: Today at 19:46:06 »
Thanks, I'll be waiting.  I have mess of a desktop computer. 
"Men, fetch the Urbanmechs.  We have an interrogation to attend to." - jklantern
"How do you defeat a Dragau? Shoot the damn thing. Lots." - Jellico 
"No, it's a "Most Awesome Blues Brothers scene Reenactment EVER" waiting to happen." VotW Destrier - Weirdo  
"It's 200 LY to Sian, we got a full load of shells, a half a platoon of Grenadiers, it's exploding outside, and we're wearing flak jackets." VoTW Destrier - Misterpants
-Editor on Battletech Fanon Wiki