1.15.2 NoClassDefFoundError

Discussion in 'Spigot Plugin Development' started by Zombieghost_391, Apr 3, 2020.

  1. Okay, so I'm trying to compile a library with my plugin (JFreeChart and JFreeCommon), but they don't see to compile since I'm getting a NoClassDefFoundError whenever a method is called. I use IntelliJ and I included them in my Module Dependencies and with my Artifact. I was getting a message "Module "plugin name" is imported from Maven. Any changes made in its configuration may be lost after importing." I wasn't 100% sure what this could mean, but it sounded to me I needed to manually include the libraries in my pom.xml file so I did. Included the error and some screenshots below.

    Any help is appreciated :)

    Code (Text):
    org.bukkit.plugin.InvalidPluginException: java.lang.NoClassDefFoundError: org/jfree/data/category/CategoryDataset
    [​IMG]

    [​IMG]

    [​IMG]
     
  2. Try building directly using Maven, instead of going through IntelliJ's layer:

    Open the console inside of IntelliJ and type
    Code (Text):
    mvn clean compile
    This should then compile your project if all your dependencies are set up correctly (if not, fix them) and then it will tell you the directory it compiled to.
     
  3. Maven shade plugin ?