1

Different servers with different java versions

TheLevi 12/30/21 4:21 pm
142
1/11/2022 7:27 pm
Hi everybody!

I recently made 2 different minecraft server, one is spigot 1.17, and the other is forge 1.16.5.

I want to host both of them (not at the same time), but one at a time, and the problem is that the 1.16.5 runs on Java 8, and the 1.17 runs on Java 16 and above.

But I can't host both the servers, because windows associates all jar files to the java that is installed earlier, so my question is:
Can i associate different server files to different java versions, and if yes, then how?

Thanks,
TheLevi
Posted by
TheLevi
Level 1 : New Explorer
0

  Have something to say?

JoinSign in

1

_Lee_
01/11/2022 7:27 pm
Level 24 : Expert Collective
history
So assuming you have a windows .bat boot file, example:
java -Xmx5G -Xms5G -jar paper-1.18.jar nogui


You would just replace the "java" part at the begging to whatever your java version path is, example:
"C:\Program Files\Java\jdk-17.0.1\bin\java.exe" -Xmx5G -Xms5G -jar paper-1.18.jar nogui

You can have multiple versions of java installed on one computer.
2

Welcome