I'm writing a plugin for Spigot/Bukkit (Minecraft) in Java and can't figure out how to fix this problem for the life of me. Although I have done a lot of programming in other languages, this is my first attempt at programming in java. I have done many google searches, looked at dozens of pages, but everything just said to do things I have already tried.
I'm using eclipse and have converted my project to and from a maven project trying all sorts of variations of installing the mongo java driver. I've tried:
- Adding dependency/s
- Adding it to the buildpath using project->properties->Java Build Path->Add External Jar
- I've done a combination of both of the above
- I've tried using mongodb-driver, mongodb-driver-core and bson together, and with mongodb-java-driver(which should just work on it's own.)
- I've tried just using mongodb-java-driver
- I've tried using many different versions of the drivers.
It doesn't matter what I do, when I export my plugin to a jar and attempt to run it on my spigot server I get the following error:
java.lang.NoClassDefFoundError: com/mongodb/MongoClientURI
Where MongoClientURI could be replaced by any mongo class I use in my code. Am I not using the driver correctly, am I missing something? What's going on?