首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >问题java gradle“找不到org.jnetpcap:jnetpcap:1.4.1。”

问题java gradle“找不到org.jnetpcap:jnetpcap:1.4.1。”
EN

Stack Overflow用户
提问于 2020-05-22 00:33:55
回答 1查看 473关注 0票数 1

对于个人项目,我想使用这个git项目:https://github.com/ahlashkari/CICFlowMeter,否则我会遇到一个问题:

代码语言:javascript
复制
type Jar
type JavaExec
:compileJava FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Could not resolve all files for configuration ':compileClasspath'.
> Could not find org.jnetpcap:jnetpcap:1.4.1.
  Searched in the following locations:
      file:/root/.m2/repository/org/jnetpcap/jnetpcap/1.4.1/jnetpcap-1.4.1.pom
      file:/root/.m2/repository/org/jnetpcap/jnetpcap/1.4.1/jnetpcap-1.4.1.jar
      https://repo.maven.apache.org/maven2/org/jnetpcap/jnetpcap/1.4.1/jnetpcap-1.4.1.pom
      https://repo.maven.apache.org/maven2/org/jnetpcap/jnetpcap/1.4.1/jnetpcap-1.4.1.jar
      https://clojars.org/repo/org/jnetpcap/jnetpcap/1.4.1/jnetpcap-1.4.1.pom
      https://clojars.org/repo/org/jnetpcap/jnetpcap/1.4.1/jnetpcap-1.4.1.jar
  Required by:
      project :

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 1s
1 actionable task: 1 executed

我做了git所要求的:

代码语言:javascript
复制
//linux :at the pathtoproject/jnetpcap/linux/jnetpcap-1.4.r1425
//windows: at the pathtoproject/jnetpcap/win/jnetpcap-1.4.r1425
mvn install:install-file -Dfile=jnetpcap.jar -DgroupId=org.jnetpcap -DartifactId=jnetpcap -Dversion=1.4.1 -Dpackaging=jar

然后

代码语言:javascript
复制
//linux:
$ sudo bash
$ gradle execute

//windows:
$ gradlew execute

(我在Fedora上)

你有什么想法吗?

EN

回答 1

Stack Overflow用户

发布于 2020-05-22 19:03:36

经过几次搜索,下面是我是如何解决这个问题的:

我打开build.gradle并在第20行替换了:

代码语言:javascript
复制
compile group: 'org.jnetpcap', name: 'jnetpcap', version:'1.4.1'

通过

代码语言:javascript
复制
compile group: 'jnetpcap', name: 'jnetpcap', version:'1.4.r1425-1g'

就是这样!

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/61939324

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档