Minecraft tool

Minecraft server Java version and startup flags

Pick your Minecraft version, server software and memory. You get the Java version the server needs, a tuned set of startup flags, and a ready start file for Windows, Linux or Mac, including the user_jvm_args.txt file Forge and NeoForge use.

Last checked . Java versions follow what each Minecraft release needs. The flags were run on Java 21 in all three sizes. Check your own server software's notes if it asks for something different.

100% freeNo sign-upRuns in your browser
This is what Java may use, not what the machine has. Leave 1 to 2 GB free for the operating system.
Start file for
Would you rather skip all of this? On ChicagoServers Minecraft hosting the panel picks the Java version and server software on the Mods tab, sets memory from your plan and restarts the server from a button. There are no start files to write or Java installs to maintain.
Start file

                

How to use the Minecraft Server Java Version and Startup Flags Generator

  1. Choose version and software. Pick the Minecraft version range and the server software. Forge and NeoForge use a different start method from the rest.
  2. Set the memory. Move the slider to the amount Java may use. Keep 1 to 2 GB free on the machine for the operating system.
  3. Copy the file. Copy the start file, or the one-line command. For Forge and NeoForge, copy the lines into user_jvm_args.txt.
  4. Check your Java. Run java -version in a terminal. The first number must match the Java version the tool shows.

Which Java each version needs

  • Minecraft 1.13 to 1.16.5: Java 8.
  • Minecraft 1.17: Java 16 at least, and Java 17 works.
  • Minecraft 1.18 to 1.20.4: Java 17.
  • Minecraft 1.20.5 to 1.21.11: Java 21.
  • Minecraft 26.1 and newer: Java 25.

A newer Java is often fine for older server software, but an older Java will not run a newer server. The server stops at startup with a class file version error when Java is too old.

What the flags do

The memory flags set the minimum and the maximum heap to the same size, so Java does not spend time growing and shrinking it. The rest tune the G1 garbage collector, the Java system that frees memory the server no longer uses. They keep the pauses short, which shows up as fewer lag spikes. They are the flags the Paper community has used for years, with the settings for heaps above 12 GB in the larger version.

One of them, AlwaysPreTouch, claims all the memory when the server starts. That makes the first start slower and means the machine must really have that memory free.

Forge and NeoForge

Forge and NeoForge for Minecraft 1.17 and newer create a run script and a file named user_jvm_args.txt when you run their installer. Put the memory and flags in that file, one per line, and start the server with the run script. Older Forge starts from a jar like the other software.

How much memory to give

Java uses more than the heap, so the machine needs spare memory on top of what you give the server. For plugin servers a few gigabytes is plenty for small groups, and modded servers with big packs need more. The RAM guide has the numbers for each case.

Frequently asked questions

Which Java do I need for Minecraft 1.21?

Java 21 for 1.20.5 through 1.21.11. Minecraft 26.1 and newer need Java 25.

Should I use these flags on vanilla?

They work, but the gain is largest on Paper and its forks. The vanilla server runs fine without them.

Why is the first start slow with these flags?

AlwaysPreTouch reserves all the memory up front. It is a one-time cost at each start.

Can I give the server all my RAM?

No. Leave at least 1 to 2 GB for the operating system and Java's own needs, or the machine will start swapping.

Where does the start file go?

In the server folder, next to the server jar. Run it from there.

Do I need this on ChicagoServers?

No. The panel sets the Java version, software and memory for you.

Minecraft hosting

Build it together, on a server that stays up.

Pick Forge, NeoForge, Fabric, Quilt, Paper or Purpur, install a modpack in one click, and keep unlimited players on one RAM-based price.

Unlimited player slotsForge, Fabric, Paper & moreFree automated backups40Gbps DDoS protection included