-1

I downloaded Jsoup and it gives me this error when I run code.

Caused by: java.lang.NoClassDefFoundError: org/jsoup/Jsoup
    at Nick.Nickname.onCommand(Nickname.java:58) ~[?:?]
    at org.bukkit.command.PluginCommand.execute(PluginCommand.java:44) ~[spigot.jar:git-Spigot-db6de12-18fbb24]
    ... 15 more
Caused by: java.lang.ClassNotFoundException: org.jsoup.Jsoup
        at java.base/java.net.URLClassLoader.findClass(Unknown Source) ~[?:?]
        at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:101) ~[spigot.jar:git-Spigot-db6de12-18fbb24]
        at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:86) ~[spigot.jar:git-Spigot-db6de12-18fbb24]
        at java.base/java.lang.ClassLoader.loadClass(Unknown Source) ~[?:?]
        at java.base/java.lang.ClassLoader.loadClass(Unknown Source) ~[?:?]
        at Nick.Nickname.onCommand(Nickname.java:58) ~[?:?]
        at org.bukkit.command.PluginCommand.execute(PluginCommand.java:44) ~[spigot.jar:git-Spigot-db6de12-18fbb24]
        ... 15 more

There's no errors on the code

`

11thdimension
  • 10,333
  • 4
  • 33
  • 71
PleaseHelpMe
  • 1
  • 1
  • 3

2 Answers2

1

The problem is with how you run your code, so we need further information on that.

You are actually getting a NoClassDefFoundError which means that the org.jsoup.Jsoup class definition was present at compile time, but during runtime when you try to instantiate it, it was not.

See this helpful article for the differences between ClassNotFoundException & NoClassDefFoundError , and you may be able to find the root cause of your error,

Evris Tzam
  • 178
  • 9
0

please check the below things to resolve your issues.

  1. did you add required jar/class files into your project's build path(library) ?
  2. does the referenced jar/class folder contains the required Jsoup class in the package org.jsoup.Jsoup ?
  3. check whether your referenced library is included in build, if your building your project like jar, war, etc,.
  4. check markers tab for errors if you are using eclipse.
Ganesh
  • 1
  • 1