Most Minecraft server startup failures that mention Java have one cause: the server JAR was compiled for a newer Java major version than the runtime actually launching it. Install the required major version, make the launch context use that executable, and start the JAR from a script so the real error remains visible.
Prefer not to run the server on your own PC? Godlike.Host offers hosted Minecraft Java servers with free DDoS protection and up to three free backups a day.
The correct version depends on both Minecraft and the server software. Vanilla Minecraft 1.18 introduced Java 17; current Paper documentation requires Java 17 for Paper 1.17–1.19, Java 21 for Paper 1.20–1.21.11, and Java 25 for Paper 26.1 and newer. Fabric requires Java 17 for Minecraft 1.17–1.20.4 and Java 21 for 1.20.5 and newer.
As an Amazon Associate I earn from qualifying purchases.
Identify the exact server and its Java requirement
Do not choose Java from the Minecraft version alone. First record the Minecraft release, the server JAR or loader, and whether a panel, service, script, or launcher starts it. The same computer can have several Java installations, and a control panel or startup script may select a different executable from the one used in an interactive terminal.
Vanilla Java Edition
Mojang’s server guidance says Java Edition needs a compatible Java installation. Minecraft 1.18 release notes state that Minecraft now uses Java 17. That makes Java 17 the baseline for a 1.18-era server, but later releases and third-party server software can require a newer major version. Always check the requirement for the exact server build you downloaded.
#1 Best Overall
- DELUXE COLLECTION — Includes Minecraft: Java & Bedrock Edition, three Bedrock add-ons, three exclusive Character Creator items, and 700 Minecoins.
- CREATE YOUR WORLD — Build whatever you imagine in an infinite world that’s unique in every playthrough.
- EXPLORE AND CRAFT — Discover biomes, resources, and mobs, then craft your way through a sandbox world filled with surprises.
- SURVIVE THE ADVENTURE — Face mysterious foes, travel across exciting landscapes, and venture into perilous dimensions.
- PLAY TOGETHER — Play cross-platform with friends in Bedrock Edition on console, mobile, and PC, or join community servers in Java Edition on PC, Mac, and Linux. Online console multiplayer requires a platform-specific subscription (sold separately).
Paper
Paper’s current compatibility table lists these requirements:
| Paper release | Required Java major version |
|---|---|
| 1.17–1.19 | Java 17 |
| 1.20–1.21.11 | Java 21 |
| 26.1 and newer | Java 25 |
A Paper JAR built for Java 21 will not start under Java 17, even if Java 17 is installed correctly for an older server.
Do these 3 things before closing this tab:
1Clear out junk files and repair common Windows errors2Fix the driver behind crashes, sound loss and screen glitches3Repair Windows errors before they cause bigger problemsFabric
Fabric’s installation documentation requires Java 17 for Minecraft 1.17 through 1.20.4 and Java 21 for Minecraft 1.20.5 and newer. Fabric’s server launcher JAR and the installed mods must also match the Minecraft release; changing Java cannot repair a loader or mod built for a different game version.
Use the same launch context to see which Java is really running
The most important diagnostic is java -version executed where the server is launched. Running it in a separate terminal can be misleading: a hosting panel, Windows shortcut, scheduled task, Docker container, or shell script may have its own PATH and Java selection.
- Stop every server instance. Close the panel task or terminal and check that no old Java process is still running.
- Open the launch context. Use the same terminal, panel console, service definition, container shell, or script that normally starts the server.
- Print the runtime version. Run
java -version. The first line contains the major version, such as 17, 21, or 25. - Find the executable selected by PATH. On Windows run
where java; on Linux or macOS runwhich java. If multiple paths appear, the first one is normally selected. - Compare the result with the server requirement. A Paper 1.20 server showing Java 17 is mismatched; a Fabric 1.20.4 server showing Java 21 is not automatically wrong, but its loader and mods still need to support that setup.
- Repeat after every change. Close and reopen the terminal or restart the panel service before running
java -versionagain, because an existing process keeps its old environment.
Reading UnsupportedClassVersionError
An error such as java.lang.UnsupportedClassVersionError means the runtime is too old for the compiled class files. Paper’s troubleshooting example shows class-file version 65 being run by a runtime that supports only through version 61. Version 65 corresponds to Java 21, while version 61 corresponds to Java 17. The solution is to run the server with Java 21 or newer as required by that build, not to reinstall the same Java 17 runtime.
Rank #2
- ULTIMATE COLLECTION — Includes Minecraft: Java & Bedrock Edition, five Bedrock add-ons, five exclusive Character Creator items, and 1000 Minecoins.
- CREATE YOUR WORLD — Build whatever you imagine in an infinite world that’s unique in every playthrough.
- EXPLORE AND CRAFT — Discover biomes, resources, and mobs, then craft your way through a sandbox world filled with surprises.
- SURVIVE THE ADVENTURE — Face mysterious foes, travel across exciting landscapes, and venture into perilous dimensions.
- PLAY TOGETHER — Play cross-platform with friends in Bedrock Edition on console, mobile, and PC, or join community servers in Java Edition on PC, Mac, and Linux. Online console multiplayer requires a platform-specific subscription (sold separately).
If the message says the class file is newer than the maximum version your runtime supports, read the two numbers as a direct comparison: the class-file target is the minimum major version needed, and the runtime’s maximum is what you currently have. If the message is different, continue to the first exception in the log rather than assuming Java is responsible.
Quick wins for a faster PC:
Scan for outdated or missing drivers - takes under a minuteDriver Scan →Clear out junk files and repair common Windows errorsFree Scan →Install the required Java and make the server use it
Windows: correct PATH or call java.exe directly
Installing Java does not guarantee that java resolves to the new installation. Windows may retain an older Java directory earlier in PATH, and a panel may store its own executable path.
- Install a Java runtime matching the server’s required major version.
- Open a new Command Prompt or PowerShell window. Existing windows keep the old PATH.
- Run
java -versionandwhere java. - If the first path is the old installation, edit the system or user PATH so the intended Java
bindirectory appears first, or remove obsolete entries that you no longer need. - Open another new terminal and verify the result again.
- If a panel or script still selects the wrong runtime, bypass PATH by calling the full executable path in the startup command.
A full-path command has the form "C:PathToJavabinjava.exe" -Xms4G -Xmx4G -jar paper.jar --nogui. Replace the path with the location shown by your installation and keep quotation marks around paths containing spaces. This makes the selected Java explicit even when PATH is shared by other applications.
Linux and macOS: verify the shell or service environment
Install the required Java major version using the distribution or vendor method appropriate for your operating system, then open a fresh shell and run java -version. If several versions are installed, select the intended one with the operating system’s Java alternatives mechanism or use an absolute path in the service or script. A system service may not read the same shell profile as your login account, so test from the service definition or container that actually launches the server.
Keep the server directory, Java path, memory options, and JAR name in one startup script. This avoids relying on whichever Java happens to be first in an administrator’s interactive PATH.
Rank #3
- Minecoins let you buy Minecraft content you can enjoy on your Android, iOS, Windows 10, Xbox One and Nintendo Switch devices*
- Visit the in-game Minecraft marketplace, where you'll discover a constantly updating library of exciting new Minecraft content - from a community whose imagination knows no limits.
- Once you've redeemed your Minecoins, they'll be linked with your Xbox Live account, so you can access your coins and purchases through all of your supported devices that run Minecraft.
- Minecoins are a perfect gift for Minecraft players!
Start the JAR from a script, not by double-clicking
Double-clicking a JAR often closes the window immediately when startup fails, hiding the exception. A script leaves the console available and makes the exact command repeatable. Run it from the directory containing the server JAR, or provide an absolute JAR path.
Paper command
Paper documents this basic command:
java -Xms4G -Xmx4G -jar paper.jar --nogui
-Xms4G sets the initial heap and -Xmx4G sets the maximum heap. Change the values to suit the machine and workload; memory settings do not fix a Java-major-version mismatch. If your downloaded file has another name, use that exact name or rename it consistently.
Fabric command
Fabric documents this form:
java -Xmx2G -jar <fabric server launcher jar file name> nogui
Replace the angle-bracketed text with the actual launcher filename. The command must be run with the Java major version required by the Minecraft release and Fabric loader.
Vanilla command
For a vanilla server, use the exact server JAR filename supplied for the release, for example:
java -Xms2G -Xmx4G -jar server.jar --nogui
Do not assume that a generic filename means you downloaded the right release. Confirm the file and Minecraft version before diagnosing Java.
Rank #4
- Fight your way through an all-new action-adventure game, inspired by classic dungeon crawlers and set in the Minecraft universe!
- Play with up to four friends or brave the dungeons alone. Battle new-and-nasty mobs across action-packed, wildly varied levels, in a quest to defeat the evil Arch-Illager!
Keep a failed Windows window open
Add pause on a new line at the end of a Windows batch file. The window then waits after an error, allowing you to copy the first exception instead of losing it when the process exits.
Separate Java errors from other startup failures
Once the runtime version is correct, inspect the server’s own evidence. Paper recommends checking latest.log, crash reports, and the first exception in the stack trace. The final line is often only a consequence; the first exception usually identifies the component that failed.
Recommended Free Tools
Plugin or mod failure
If a plugin name appears in the first exception, stop the server and temporarily remove or disable that plugin. If the server starts, restore plugins in small groups or use a binary-search approach to identify the incompatible one. For Fabric, perform the same isolation with mods and verify that each mod targets the exact Minecraft and loader versions. Do not delete a world to test a plugin or mod; make a backup first.
Port binding failure
A message that the server cannot bind to its port usually means another Java process is already using that port, or the configured server-ip is incorrect. This is not a Java-version mismatch. Stop the old server process, choose an unused port, or correct the bind address. Leave server-ip blank unless you specifically need to bind to one local interface.
World saved by a newer version
A “world saved with newer version” error means the world was opened by a newer server than the one you are starting. Downgrading is unsupported and can corrupt data. Restore a backup made before the upgrade, or run the world on a compatible newer server. Do not force a downgrade with an override designed to suppress the warning.
Best Value
- ✓ MODDING and CODING for all kids, not JUST GAMERS: Create Minecraft Games by coding your own custom blocks, tools, armor, weapons, and much more! Gaming is a popular topic among youth and many consider themselves gamers. We use computer games as a fun medium to help students understand computer logic.
- ✓ LIVE MENTOR SUPPORT: Chat directly with a real human mentor for help designing and coding games using our Minecraft Mod Java game design tutorials. Unlike other online coding programs for kids that offer you a how-to sheet and let you learn from there, we offer live chat assistance.
- ✓ SCHOOL and HOMESCHOOL APPROVED CURRICULUM and STEM CERTIFIED: Simply Coding courses have been approved by school systems throughout the world, both as an elective and as an after school program. Including receiving high school credit for course completion.
- ✓ DESIGNED BY PROFESSIONAL PROGRAMMERS with LIFETIME UPDATES to the latest Minecraft forge versions. The feedback of thousands of teens helps us test, refine, and perfect our system. This is the perfect gift for boys or girls ages 11 and up.
- ✓ COMPATIBLE WITH PC or MAC: For this course, you need either Windows 10 computer or an Apple Computer version 10.13 or higher. Then simply access our online class via the provided pin code, create an account, and start learning from our step by step tutorials.
Missing or invalid files
A Java installation cannot repair a missing JAR, a corrupt download, a wrong filename, or a directory permission problem. Confirm that the command points to the intended file, that the account running the service can read the directory, and that the server has completed its first-run setup. Keep separate folders for different Minecraft versions so an older script cannot accidentally launch a newer or renamed JAR.
The Tool Desk
Outbyte PC Repair FREERepair Windows errors before they cause bigger problemsFix Now →Outbyte Driver Updater FREEScan for outdated or missing drivers - takes under a minuteDriver Scan →Vanilla, Paper, and Fabric: what changes besides Java?
Choosing server software affects compatibility work as much as choosing a runtime.
| Software | Java guidance | Extensions | Startup and maintenance considerations |
|---|---|---|---|
| Vanilla | Use the Java major version required by the Minecraft release; Minecraft 1.18 introduced Java 17. | Official server behavior; no Paper plugin API or Fabric mod loader. | Use the release’s exact server JAR, accept the EULA during first setup, and maintain your own scripts, memory settings, backups, firewall rules, and port forwarding. |
| Paper | Java 17 for 1.17–1.19; Java 21 for 1.20–1.21.11; Java 25 for 26.1+. | Supports Paper-compatible plugins. | Plugin compatibility and Java requirements can change between releases. Keep a plugin inventory, test updates on a copy, and read the first exception when startup fails. |
| Fabric | Java 17 for 1.17–1.20.4; Java 21 for 1.20.5+. | Uses Fabric mods rather than Paper plugins. | The launcher JAR, loader, API, mods, and Minecraft version must align. Keep the exact launcher filename in the script and update the whole set deliberately. |
These choices are not interchangeable. A Paper plugin cannot be made compatible with Fabric by changing Java, and a Fabric mod cannot be loaded by a vanilla server. Java solves runtime compatibility; it does not convert one server ecosystem into another.
A repeatable recovery checklist
- Write down the Minecraft version, server software, loader version, and exact JAR filename.
- Back up the world, configuration, plugins or mods, and server properties before changing versions.
- Run
java -versionin the same context that launches the server. - Use
where javaon Windows orwhich javaon Linux and macOS to detect PATH conflicts. - Install the required Java major version and restart the terminal, panel, or service.
- Use an absolute Java path if PATH still selects the wrong executable.
- Start from a script with the exact JAR name and keep the console visible.
- If the error persists, read the first exception in
latest.logor the crash report. - Isolate a named plugin or mod, then restore components one at a time.
- For port errors, check running processes and network settings instead of reinstalling Java.
- For newer-world errors, use a compatible newer server or a pre-upgrade backup; do not force a downgrade.
When managed hosting is the practical alternative
Running a server locally requires maintaining Java versions, startup scripts, memory limits, backups, firewall rules, and port forwarding. Managed Minecraft server hosting can handle some of that administration, but support is not universal. Before subscribing, confirm that the provider supports the exact Minecraft release, server software, Java major version, plugins or mods, backup schedule, and console access you need. You still need a backup and a way to identify the first exception when an extension is incompatible.
Final diagnosis
If the log contains UnsupportedClassVersionError, compare the class-file target with the runtime shown by java -version, then launch the server with the required Java executable. If the runtime is already compatible, stop treating the problem as a Java issue: use the first exception in the log to investigate plugins, mods, ports, files, permissions, or a world created by a newer server. Keeping a version-specific startup script and backup turns future Java upgrades into a controlled change rather than a guessing exercise.
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.




