NYXONYXO JAR
Home / NoClassDefFoundError

Fix NoClassDefFoundError in plugins

The server tried to load a class required by the plugin but could not find it at runtime. Compare the class name with project dependencies and the packaged JAR.

Fix NoClassDefFoundError in plugins — NYXO JAR

What does NoClassDefFoundError mean?

java.lang.NoClassDefFoundError appears when the JVM tries to use a class it expected to find but cannot load at runtime. In a Minecraft plugin, a common cause is a library the code needs that is missing from the server's classpath. The library may exist only on the developer's computer, or it may be declared compile-only and not provided by the server. Read the full class name after the message; it often identifies the dependency that failed.

ClassNotFoundException is related but often appears when code requests a class by name at runtime, such as through Class.forName or a loader. NoClassDefFoundError more often appears while the JVM links a required class. A later message may say Could not initialize class; the class may exist, but its static initializer failed during the first load. Do not respond to every wording by adding the same library to the JAR.

Identify which dependency owns the class

Copy the package name, such as com.example.library.Widget, and search for it in the build file or the JAR. Its approximate archive path is com/example/library/Widget.class. If the package belongs to your project, the class may not have compiled, its package may have changed, or the artifact may be incomplete. If it belongs to an external library, determine whether that library should be packaged or supplied by the server.

Compare the build environment with runtime. A successful compile does not prove all dependencies will be available on the server. Maven and Gradle distinguish compile and runtime scopes; source compilation can pass while a plugin fails after installation because a library was left out of the package. Inspect the resolved dependency list instead of assuming a local library folder was uploaded.

When to use Shade or Shadow

If a library is not part of Paper or Spigot and the server does not provide it, the project usually needs to package it or make it available through another reliable mechanism. Maven developers often use maven-shade-plugin; Gradle developers may use a plugin such as Shadow to create a combined JAR. Follow the library and platform instructions and confirm that the packaging task actually runs. A project may create a regular JAR and a second file named -all or -shaded; you may have uploaded the wrong artifact.

Do not bundle everything indiscriminately. The server API is normally supplied by the server and should not be copied into the plugin. Packaging another copy of a library the server already provides can cause classloader conflicts. If a library is common across plugins, a developer may need relocation to change its namespace and prevent package collisions; that is a build configuration change, not a universal fix for server owners. Test the shaded artifact and confirm its license permits redistribution.

Check the library version and loading path

If the class appears to exist in a JAR but the error remains, inspect the cause. The dependency may be an older version that does not contain the class, the package may have changed between releases, or the missing class may belong to Java itself and be unavailable in the selected runtime. Check the Java requirement with the version chart. If the message is UnsupportedClassVersionError instead, the issue is bytecode compatibility rather than a missing dependency.

Also inspect load order and optional dependencies. The plugin may reference a class only when another plugin is installed but fail to check whether that dependency is present. Or plugin.yml may name a main class that is missing from the package. Open the JAR, check the class path, and compare it with the descriptor's main value. If the class is present, look for an earlier Caused by line; the root cause may explain why another library failed to initialize.

Test the package and runtime

  1. Copy the complete missing class name and the first associated cause.
  2. Find the dependency that owns the package and verify its version.
  3. Inspect the final JAR, not a cache or stale build directory.
  4. Rebuild and test on a server with the target Minecraft, Java, and platform versions.

Do not download a random JAR and drop it into plugins just to see whether the message disappears; that can introduce untrusted code and hide the real cause. If you used NYXO JAR, review the downloaded artifact and the build task that created it. The guides for Maven and Gradle explain where dependency and packaging settings live.

When the cause is something else

If the log says Unsupported API version, check api-version and the server release rather than bundling a library. With NoSuchMethodError, the class exists but the method is incompatible with the version available at runtime. With ExceptionInInitializerError or Could not initialize class, inspect the earlier cause because a static initializer may have failed due to configuration or another dependency. The general troubleshooting guide covers these signals; choose the page that matches the actual message.

When asking for help, include the class name, the first few stack-trace lines, server and Java versions, and the dependency version you expect. Remove usernames, private paths, and credentials. You usually do not need to send a database or an entire server folder; a relevant log and a sanitized build file are enough.

Ready? Upload your project and download the JAR.Build your project
Read next:Guides and quick fixes related to this topic.