I'm trying to use MaxMind's GeoIP2 database, I've added the jar to my Java build path and configured it with Javadoc and source but when I run the program I get a NoClassDefFound error, which according to this stack overflow answer is because I need to add the dependencies, but I have no clue how to add them in eclipse, I tried extracting the jar files and adding them to the build path but that didn't work, how do I do this in eclipse?
Thanks for any help.
In eclipse you have to create a new
maven java project
. If you dont knowmaven
you can get informations here:apache maven startsite
how to install maven
Afer that you are able to configure your dependencies in your
pom.xml
file. Which is the configuration file for maven.You can find some dependencies for your usage here:
maxmind documentation
The include of the dependency would look like this:
But first, you should look at maven installation and using. It will make your life easier by handling all the necessary dependencies you will need in this project and in all of your other projects in future.