gpt4 book ai didi

java - 发出Java Gradle “Could not find org.jnetpcap:jnetpcap:1.4.1.”

转载 作者:行者123 更新时间:2023-12-03 04:09:23 29 4
gpt4 key购买 nike

对于个人项目,我想使用以下git项目:https://github.com/ahlashkari/CICFlowMeter或我有一个问题:

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问到:
//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

然后
//linux:
$ sudo bash
$ gradle execute

//windows:
$ gradlew execute

(我在Fedora上)

你有什么想法 ?
谢谢你的时间。

最佳答案

经过几次搜索,以下是我解决此问题的方法:

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

compile group: 'org.jnetpcap', name: 'jnetpcap', version:'1.4.1'

通过
compile group: 'jnetpcap', name: 'jnetpcap', version:'1.4.r1425-1g'

而已 !

关于java - 发出Java Gradle “Could not find org.jnetpcap:jnetpcap:1.4.1.”,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61939324/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com