I have a physical server with several dedicated Java servers in 1.12.2 and I tried creating a 1.17 world but it requires Java 16 instead of the Java 8 that 1.12.2 requires. Both versions of Java are installed and.I have gone into the control panel and added them to PATH. 1.12.2 is working but 1.17 cannot pick out the correct Java version.
I have tried running only 8 and only the 1.12.2 worlds work.
I have tried just running 16 and only the 1.17 world works.
Please advise.
Comments 2
Add this into the 1.12 server's .bat file:
set javafor112=C:\Program Files\Java\jre1.8.0_281\bin
...and replace the "java" word (or "java.exe") in the launch line for %javafor112%\java.exe
But you can simply put the full route like:
"C:\Program Files\Java\jre1.8.0_281\bin\java.exe" -jar minecraftserver.jar blablablabla
("" are necesary because there are a space in the route/dir)
Not sure how to handle this in Windows, but in Linux I set the JAVA_HOME variable in my server launch script to point explicitly to an OpenJDK 16 folder, while my older servers use the system OpenJDK 8. That looks like this:
Again, not sure how to handle this in Windows, but you need to set your JAVA_HOME and PATH variables suitably in the launch script for the 1.17 server.