Problem
I want to run two servers, one in 1.17 using Java 16 and the other in 1.12.2 using Java 8.
The argument I want to use in the .bat file is "C:\Program Files\Java\jre1.8.0_291\lib" -jar
but it doesn't work.
.bat
The full .bat is as such.
@ECHO OFF
java -Xms10G -Xmx10G -XX:+UseG1GC -XX:+ParallelRefProcEnabled -XX:MaxGCPauseMillis=200 -XX:+UnlockExperimentalVMOptions -XX:+DisableExplicitGC -XX:-OmitStackTraceInFastThrow -XX:+AlwaysPreTouch -XX:G1NewSizePercent=30 -XX:G1MaxNewSizePercent=40 -XX:G1HeapRegionSize=8M -XX:G1ReservePercent=20 -XX:G1HeapWastePercent=5 -XX:G1MixedGCCountTarget=8 -XX:InitiatingHeapOccupancyPercent=15 -XX:G1MixedGCLiveThresholdPercent=90 -XX:G1RSetUpdatingPauseTimePercent=5 -XX:SurvivorRatio=32 -XX:MaxTenuringThreshold=1 -Dusing.aikars.flags=true -Daikars.new.flags=true "C:\Program Files\Java\jre1.8.0_291\bin\java.exe" -jar forge-1.12.2-14.23.5.2855.jar --nogui
pause
Error message
The error given is:
Error: Could not find or load main class C:\Program Files\Java\jre1.8.0_291\bin\java.exe
Caused by: java.lang.ClassNotFoundException: C:\Program Files\Java\jre1.8.0_291\bin\java.exe
I don't know how to resolve the error of the java class not being found.
Additional details
I am running JRE 16 and Java 8 on the same computer. Only the 1.17 servers start with this installation set up.
The 1.12.2 server starts when I uninstall JRE 16.