Fixing Java Version Mismatches
Aug 11, 2026
Which Java version does your server need?
Every Minecraft version requires a specific minimum Java version. Using the wrong one produces an error like "A JNI error has occurred" or "class file has wrong version." Here is the quick reference:
- Minecraft 1.18 and newer: Java 17 or later
- Minecraft 1.21 and newer: Java 21 or later
- Minecraft 1.17: Java 16
- Minecraft 1.12 to 1.16.5: Java 8
Forge and NeoForge servers sometimes have their own Java requirements on top of this. Check your loader's documentation if the above does not fix it. Coalstack detects the version mismatch when you try to start a server and will tell you if your Java installation is too old.
Checking what Java you have installed
Open a Command Prompt and run java -version. The first line of output tells you the version. It will look something like openjdk version "21.0.5" or java version "1.8.0_401".
Coalstack also shows the detected Java version on the server's card and in the Dashboard. If it cannot find a Java installation at all, the server card will show a warning with a link to download one.
If you have multiple Java versions installed (common if you run servers on different Minecraft versions), Coalstack picks the newest one by default. You can override this per server in the Settings page.
Installing the right Java version
The safest option is to install the latest Java 21 (LTS) from Adoptium. It covers every Minecraft version from 1.18 onward, which is most servers running today. Download the .msi installer for Windows, run it, and accept the defaults. Coalstack will detect it on the next launch.
If you are running an older server on Java 8, install that alongside Java 21. Both can coexist. In Coalstack's Settings page, set the Java path for that specific server to point at the Java 8 installation so it does not pick up Java 21 by accident.
After installing or changing Java, restart Coalstack so it rescans the available runtimes. The server card should update to show the new version.

