如何为maxmind geoip2 eclipse添加依赖项 [英] How to add dependencies for maxmind geoip2 eclipse

查看:349
本文介绍了如何为maxmind geoip2 eclipse添加依赖项的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用 MaxMind的GeoIP2数据库,我添加了jar到我的Java构建路径并配置它与Javadoc和源,但是当我运行程序时,我得到一个NoClassDefFound错误,根据这个堆栈溢出 answer 是因为我需要添加依赖关系,但是我不知道如何将它们添加到eclipse中,我尝试解压缩jar文件并将其添加到构建路径但是没有起作用,我该如何在eclipse中执行此操作?



感谢任何帮助。

$ b $在eclipse中,你必须创建一个新的 maven java项目。如果您不知道 maven ,您可以在这里获取信息:



apache maven startsite



如何安装maven



您可以在 pom中配置依赖项。 xml 文件。哪个是maven的配置文件。



您可以在这里找到一些依赖关系:



maxmind文档



依赖项的包含如下所示:

 <依赖关系> 
< groupId> com.maxmind.geoip2< / groupId>
< artifactId> geoip2< / artifactId>
< version> v2.3.0< / version>
< / dependency>

但首先,您应该看看maven的安装和使用。这将使您的生活更轻松,通过处理您将来在此项目和所有其他项目中需要的所有必要依赖关系。


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 know maven 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:

 <dependency>
    <groupId>com.maxmind.geoip2</groupId>
    <artifactId>geoip2</artifactId>
    <version>v2.3.0</version>
</dependency>

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.

这篇关于如何为maxmind geoip2 eclipse添加依赖项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆