Jump to content

Minecraft server (Not sure if this is the right place however my issue is more with software not the server itself.)

BOTDead

So Im trying to run 1.17.1 servers on mc aswell as other outdated servers like 1,12,2, However Java 16 is required to run the 1.17.1 server, and the rest of my server use Java 8, Is there anyway I can have Java 16 and Java 8 at the same time and make it so both server use different versions of java? Im going to be launching the servers using a .bat file.

Link to comment
Share on other sites

Link to post
Share on other sites

You can specify which version of Java you want when you go to run the server by listing the actual path to it. For instance, to launch it with java 8, run this command:

"C:\Program Files\AdoptOpenJDK\jre-8.0.292.10-hotspot\bin\java.exe" -jar MinecraftServer.jar --nogui

Then to launch against say Java 16, run something like this:

"C:\Program Files\AdoptOpenJDK\jre-16.x.x.x-hotspot\bin\java.exe" -jar MinecraftServer.jar --nogui

You'll have to change the path to the path you have, this is for OpenJDK (what I currently have installed on my computer) and for very specific versions of java. Your paths will almost certainly be different, and you'll have to look to see where it is.

Link to comment
Share on other sites

Link to post
Share on other sites

On 10/23/2021 at 12:29 AM, RONOTHAN## said:

You can specify which version of Java you want when you go to run the server by listing the actual path to it. For instance, to launch it with java 8, run this command:


"C:\Program Files\AdoptOpenJDK\jre-8.0.292.10-hotspot\bin\java.exe" -jar MinecraftServer.jar --nogui

Then to launch against say Java 16, run something like this:


"C:\Program Files\AdoptOpenJDK\jre-16.x.x.x-hotspot\bin\java.exe" -jar MinecraftServer.jar --nogui

You'll have to change the path to the path you have, this is for OpenJDK (what I currently have installed on my computer) and for very specific versions of java. Your paths will almost certainly be different, and you'll have to look to see where it is.

alright thanks!

Link to comment
Share on other sites

Link to post
Share on other sites

  • 3 weeks later...
On 10/23/2021 at 12:29 AM, RONOTHAN## said:

You can specify which version of Java you want when you go to run the server by listing the actual path to it. For instance, to launch it with java 8, run this command:

"C:\Program Files\AdoptOpenJDK\jre-8.0.292.10-hotspot\bin\java.exe" -jar MinecraftServer.jar --nogui

Then to launch against say Java 16, run something like this:

"C:\Program Files\AdoptOpenJDK\jre-16.x.x.x-hotspot\bin\java.exe" -jar MinecraftServer.jar --nogui

You'll have to change the path to the path you have, this is for OpenJDK (what I currently have installed on my computer) and for very specific versions of java. Your paths will almost certainly be different, and you'll have to look to see where it is.

Alright im super sorry to kind of revive a dead thread, however I didn't see the point in making a new one... I've found the paths from what I can see I just cant find out how to add more ram onto the argument? If thats something you can help me with?

Link to comment
Share on other sites

Link to post
Share on other sites

3 hours ago, BOTDead said:

Alright im super sorry to kind of revive a dead thread, however I didn't see the point in making a new one... I've found the paths from what I can see I just cant find out how to add more ram onto the argument? If thats something you can help me with?

It's fairly easy. You just need to add another flag to the startup options. 

"C:\Program Files\AdoptOpenJDK\jre-16.x.x.x-hotspot\bin\java.exe" -jar MinecraftServer.jar -Xmx2G -Xms2G --nogui

The "-Xmx2G" option says that the server can use a maximum of 2GB of RAM. The "-Xms2G" says that the server can use a minimum of 2GB of RAM. If you change it to "Xmx1536M" That will dedicate a maximum of 1.5GB of RAM, or 1536MB. Change those options so that it's using the amount of RAM you feel comfortable dedicating to the server. Unless you're running modded or have 25+ people on at a time, 2GB should be more than enough. 

Link to comment
Share on other sites

Link to post
Share on other sites

On 11/13/2021 at 12:46 PM, RONOTHAN## said:

It's fairly easy. You just need to add another flag to the startup options. 

"C:\Program Files\AdoptOpenJDK\jre-16.x.x.x-hotspot\bin\java.exe" -jar MinecraftServer.jar -Xmx2G -Xms2G --nogui

The "-Xmx2G" option says that the server can use a maximum of 2GB of RAM. The "-Xms2G" says that the server can use a minimum of 2GB of RAM. If you change it to "Xmx1536M" That will dedicate a maximum of 1.5GB of RAM, or 1536MB. Change those options so that it's using the amount of RAM you feel comfortable dedicating to the server. Unless you're running modded or have 25+ people on at a time, 2GB should be more than enough. 

Yea I know all the ram mechanics I just never knew where on the line to put the Ram, Again thanks so much for your insight!

Link to comment
Share on other sites

Link to post
Share on other sites

22 minutes ago, BOTDead said:

Yea I know all the ram mechanics I just never knew where on the line to put the Ram, Again thanks so much for your insight!

Before or after works. As long as it's in there you should be fine. 

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×