Legacy Forge launchwrapper ClassCastException (URLClassLoader)
Legacy Forge (Minecraft 1.12 and older) starts mods through launchwrapper, which casts the classloader to a URLClassLoader. Java 9+ replaced that classloader hierarchy, so any modern Java crashes legacy Forge at boot with a ClassCastException naming URLClassLoader. The pack is fine; the JVM is simply too new.
Fastest path: paste your crash report into the Crash Doctor — it identifies this pattern and 40+ others automatically. No signup.
How to fix it
- 1
Switch the server to Java 8
Minecraft 1.7 through 1.12 with Forge requires Java 8 specifically. On CoalHosting that is Settings → Runtime; on a self-hosted box install a Java 8 JDK and point the startup script at it.
- 2
Verify the runtime actually in use
Run java -version from the server's working directory. Panel settings and PATH can disagree — the version in the boot log header is the truth.
- 3
Do not 'upgrade to be safe'
Newer Java is not a free improvement for old packs. RLCraft, old Feed The Beast packs and most 1.12-era servers break on Java 9+ by design of launchwrapper.
- 4
Re-test after the switch
Boot once with no changes beyond Java. If a different error appears, that is the next real problem — fix them one at a time, not all at once.
Alternative causes
These can produce the same error message — worth ruling out if the steps above don't resolve it.
A single mod compiled for newer Java inside an old pack
That produces UnsupportedClassVersionError instead of a ClassCastException. Different error, different fix — see the related article.
Corrupted launchwrapper jar
Rare, but a half-copied launchwrapper produces the same cast error on the correct Java. Redownload the Forge installer jar if Java 8 still fails.
Frequently asked
Can I run a 1.12 Forge server on Java 17?
No. launchwrapper's URLClassLoader cast was removed in Java 9's module system. Legacy Forge requires Java 8 regardless of available memory or performance flags.
Does this affect Minecraft 1.16 and newer?
No. Forge dropped launchwrapper for modern versions; 1.17+ runs on Java 17 and 1.20.5+ on Java 21. The cast error only affects the 1.7–1.12 era.
Why do old packs break on new Java at all?
Java 9 changed the internal classloader APIs launchwrapper relied on. Mojang and Forge rewrote loading for newer versions, but 1.12-era Forge was never backported.
Want this auto-fixed on your server?
CoalHosting's Minecraft hosting runs the same pattern database against every crash and applies the known fix before your players notice. Free crash diagnosis works on any server, hosted or not.
Related crashes
java.lang.UnsupportedClassVersionError
Fix the Minecraft server UnsupportedClassVersionError crash — the Java runtime is newer or older than the mod …
Mixin apply failed (MixinTransformerError)
Fix Minecraft Mixin apply failed crashes — one mod tried to inject into a class another mod or MC version chan…
Sinytra Connector ERROR
Fix Sinytra Connector errors on Minecraft Forge servers — almost always a Fabric mod that doesn't translate cl…
Last reviewed 2026-09-06. If a step is wrong or out of date, tell us — we'll fix the article and the auto-pattern at the same time.