java.lang.NoClassDefFoundError
NoClassDefFoundError means the JVM can find a reference to a class (so the calling code compiled fine) but the class itself is missing at runtime. In Minecraft modding this almost always means a mod jar that should be in mods/ isn't there, or two mods reference different incompatible versions of a shared library class.
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
Find the missing class in the error
The error reads something like 'NoClassDefFoundError: com/moulberry/notenoughcoordinates/NEC'. The package (com.moulberry.notenoughcoordinates) is the mod that supplies that class. Check whether that mod is in mods/ and is the right version.
- 2
Restore or update the mod that owns the missing class
If the class is from a mod you expected to be loaded, put it back in mods/. If it's from a library mod (Architectury, Cloth Config, GeckoLib, Patchouli), grab the latest for your MC version from CurseForge — library mods ship new class names across versions and old callers can reference names that only exist in newer builds.
- 3
Look for two copies of the same library at different versions
Sometimes two mods bundle their own copy of a shared library, and the JVM picks one, leaving the other's class names unreachable. In Forge this usually appears in logs as 'duplicate mods'. In Fabric, the metadata resolver catches most of it. Remove the extra copy.
- 4
Check after Sinytra Connector or Loader migration
If you're running Fabric mods on Forge via Connector, or migrated from Forge to NeoForge, classes from the old loader environment are genuinely absent. Find native alternatives for mods that relied on the old runtime.
Alternative causes
These can produce the same error message — worth ruling out if the steps above don't resolve it.
JVM loaded the wrong .jar from the classpath
If the same library ships both a standalone .jar in mods/ and a shaded version inside another mod, the JVM might load the shaded one first and ignore the standalone. The class references in the shaded version often don't match the API the calling mod expects.
Cascading from a Mixin or Sinytra Connector failure
A NoClassDefFoundError is a frequent cascade after a mixin or Connector error fires first. Find the root cause earlier in the log — fixing that eliminates the cascade.
Frequently asked
What's the difference between NoClassDefFoundError and ClassNotFoundException?
ClassNotFoundException is thrown when code explicitly asks for a class by name (Class.forName) and it's not found. NoClassDefFoundError is thrown when the JVM needs a class at compile-time-linked code and can't find it at runtime — the reference was baked in. Both mean 'class missing', but NCDFE is the more common crash signature in mods.
Is this ever a Java version problem?
Rarely. If the missing class is in java.* or javax.* it might be a Java version issue — some classes were removed in Java 11 (javax.xml.bind, com.sun.*). But the vast majority of NCDFE in Minecraft is mod-related, not Java-version-related.
Why does the same crash not happen on my friend's server?
Their mods/ has the mod that provides the class. Compare your mods list against theirs — something is missing from yours or extra from theirs.
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.NoSuchMethodError
Fix Minecraft NoSuchMethodError crashes — almost always a mod-version mismatch between two mods that disagree …
Missing mod dependency (mod requires X which is not present)
Fix Minecraft 'mod requires X which is not present' errors — the loader found a mod but its required companion…
Mixin apply failed (MixinTransformerError)
Fix Minecraft Mixin apply failed crashes — one mod tried to inject into a class another mod or MC version chan…
Last reviewed 2026-06-15. If a step is wrong or out of date, tell us — we'll fix the article and the auto-pattern at the same time.