gpt4 book ai didi

java - 如何使 Netty 示例正常运行

转载 作者:行者123 更新时间:2023-12-02 03:58:20 26 4
gpt4 key购买 nike

我试图下载 Netty Source Code并运行包含的示例。

我安装的jdk版本是1.8.0_65

我尝试使用 maven(mvn eclipse:eclipse) 将示例(在示例文件夹 ...\netty-4.1\example 中)转换为 Eclipse 项目。

但是出现了下面所说的构建错误。

[INFO]
[INFO] >>> maven-eclipse-plugin:2.10:eclipse (default-cli) > generate-resources @ netty-example >>>
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.558 s
[INFO] Finished at: 2016-02-04T13:40:13+08:00
[INFO] Final Memory: 11M/28M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project netty-example: Could not resolve dependencies for project io.netty:netty-example:jar:4.1.0.CR2-SNAPSHOT: Failure to fi
nd io.netty:netty-tcnative:jar:windows-x86_32:1.1.33.Fork11 in https://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be r
eattempted until the update interval of central has elapsed or updates are forced -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal on project netty-example: Could not resolve dependencies for project io.netty:net
ty-example:jar:4.1.0.CR2-SNAPSHOT: Failure to find io.netty:netty-tcnative:jar:windows-x86_32:1.1.33.Fork11 in https://repo.maven.apache.org/maven2 was cached i
n the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced
at org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.getDependencies(LifecycleDependencyResolver.java:221)
at org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.resolveProjectDependencies(LifecycleDependencyResolver.java:127)
at org.apache.maven.lifecycle.internal.MojoExecutor.ensureDependenciesAreResolved(MojoExecutor.java:245)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:199)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.MojoExecutor.executeForkedExecutions(MojoExecutor.java:352)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:197)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:863)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:199)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Caused by: org.apache.maven.project.DependencyResolutionException: Could not resolve dependencies for project io.netty:netty-example:jar:4.1.0.CR2-SNAPSHOT: Fai
lure to find io.netty:netty-tcnative:jar:windows-x86_32:1.1.33.Fork11 in https://repo.maven.apache.org/maven2 was cached in the local repository, resolution wil
l not be reattempted until the update interval of central has elapsed or updates are forced
at org.apache.maven.project.DefaultProjectDependenciesResolver.resolve(DefaultProjectDependenciesResolver.java:211)
at org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.getDependencies(LifecycleDependencyResolver.java:195)
... 27 more
Caused by: org.eclipse.aether.resolution.DependencyResolutionException: Failure to find io.netty:netty-tcnative:jar:windows-x86_32:1.1.33.Fork11 in https://repo
.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are
forced
at org.eclipse.aether.internal.impl.DefaultRepositorySystem.resolveDependencies(DefaultRepositorySystem.java:384)
at org.apache.maven.project.DefaultProjectDependenciesResolver.resolve(DefaultProjectDependenciesResolver.java:205)
... 28 more
Caused by: org.eclipse.aether.resolution.ArtifactResolutionException: Failure to find io.netty:netty-tcnative:jar:windows-x86_32:1.1.33.Fork11 in https://repo.m
aven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are fo
rced
at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:444)
at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifacts(DefaultArtifactResolver.java:246)
at org.eclipse.aether.internal.impl.DefaultRepositorySystem.resolveDependencies(DefaultRepositorySystem.java:367)
... 29 more
Caused by: org.eclipse.aether.transfer.ArtifactNotFoundException: Failure to find io.netty:netty-tcnative:jar:windows-x86_32:1.1.33.Fork11 in https://repo.maven
.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced

at org.eclipse.aether.internal.impl.DefaultUpdateCheckManager.newException(DefaultUpdateCheckManager.java:231)
at org.eclipse.aether.internal.impl.DefaultUpdateCheckManager.checkArtifact(DefaultUpdateCheckManager.java:206)
at org.eclipse.aether.internal.impl.DefaultArtifactResolver.gatherDownloads(DefaultArtifactResolver.java:585)
at org.eclipse.aether.internal.impl.DefaultArtifactResolver.performDownloads(DefaultArtifactResolver.java:503)
at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:421)
... 31 more
[ERROR]
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException

我按照消息中提到的线索进行了追踪。我发现this solution链接到 http://netty.io/wiki/forked-tomcat-native.html#wiki-h3-6 .

我认为这可能不适合我的目的。(我只想运行这些示例)。

所以我想知道要下载什么 Netty 开发库来开始 Netty 应用程序开发。或者任何 Pom.xml 共享链接都可以轻松包含在示例项目中?谢谢。

最佳答案

这个答案是根据 bug report 做出的关于 Netty 项目。

要构建Netty项目,您应该结合使用64位操作系统和64位JVM。这是因为 Netty 项目使用的依赖项之一仅支持 64 位。

根据mvn -version的输出,您正在32位JVM上运行。您应该能够从 official java website 下载 64 位 JVM。 .

升级到 64 位 JVM 还具有以下优势:

  • 您可以运行内存超过 2 GB 的程序
  • 使用 longdouble 进行计算会更快,因为 java 可以使用 native 处理器

有关差异,请参阅:Benefits of 64bit java platform

您不需要自己编译示例,您也可以在mavencentral上找到它们,按版本排序:http://central.maven.org/maven2/io/netty/netty-example/

关于java - 如何使 Netty 示例正常运行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35194395/

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