Netty编译错误

发布于 2025-01-07 16:03:30 字数 1470 浏览 3 评论 0原文

我无法再编译netty了。 mvncompile 给出以下内容:

[INFO] --- maven-compiler-plugin:2.3.2:compile (default-compile) @ netty-common ---
[INFO] Compiling 60 source files to /home/dennis/git/netty4/common/target/classes
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR : 
[INFO] -------------------------------------------------------------
[ERROR] Unable to locate the Javac Compiler in:
  /opt/java/jre1.6.0_30/../lib/tools.jar
Please ensure you are using JDK 1.4 or above and
not a JRE (the com.sun.tools.javac.Main class is required).
In most cases you can change the location of your Java
installation by setting the JAVA_HOME environment variable.
[INFO] 1 error

我的配置:

export JAVA_HOME=/opt/java/jre1.6.0_30
export M2_HOME=/opt/apache-maven-3.0.3
export M2=$M2_HOME/bin
export PATH=$JAVA_HOME/bin:$PATH
export PATH=$M2:$PATH

我的路径的一部分:

$echo $PATH
/opt/java/jre1.6.0_30/bin:/opt/apache-maven-3.0.3/bin:/opt/git/bin:[...]

Maven 状态:

dennis@denpc:~/git/netty4$ mvn --version
Apache Maven 3.0.3 (r1075438; 2011-02-28 18:31:09+0100)
Maven home: /opt/apache-maven-3.0.3
Java version: 1.6.0_30, vendor: Sun Microsystems Inc.
Java home: /opt/java/jre1.6.0_30
Default locale: de_DE, platform encoding: UTF-8
OS name: "linux", version: "2.6.24-30-generic", arch: "i386", family: "unix"

有什么想法吗?

I can't compile netty anymore. mvn compile gives the following:

[INFO] --- maven-compiler-plugin:2.3.2:compile (default-compile) @ netty-common ---
[INFO] Compiling 60 source files to /home/dennis/git/netty4/common/target/classes
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR : 
[INFO] -------------------------------------------------------------
[ERROR] Unable to locate the Javac Compiler in:
  /opt/java/jre1.6.0_30/../lib/tools.jar
Please ensure you are using JDK 1.4 or above and
not a JRE (the com.sun.tools.javac.Main class is required).
In most cases you can change the location of your Java
installation by setting the JAVA_HOME environment variable.
[INFO] 1 error

My configuration:

export JAVA_HOME=/opt/java/jre1.6.0_30
export M2_HOME=/opt/apache-maven-3.0.3
export M2=$M2_HOME/bin
export PATH=$JAVA_HOME/bin:$PATH
export PATH=$M2:$PATH

A part of my path:

$echo $PATH
/opt/java/jre1.6.0_30/bin:/opt/apache-maven-3.0.3/bin:/opt/git/bin:[...]

Maven status:

dennis@denpc:~/git/netty4$ mvn --version
Apache Maven 3.0.3 (r1075438; 2011-02-28 18:31:09+0100)
Maven home: /opt/apache-maven-3.0.3
Java version: 1.6.0_30, vendor: Sun Microsystems Inc.
Java home: /opt/java/jre1.6.0_30
Default locale: de_DE, platform encoding: UTF-8
OS name: "linux", version: "2.6.24-30-generic", arch: "i386", family: "unix"

Any ideas?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

記憶穿過時間隧道 2025-01-14 16:03:30

请确保您使用的是 JDK 1.4 或更高版本并且
不是 JRE
[...]

这可能与您上面帖子中给出的错误中的这一行有关。我相信您可能还想确保您也拥有 JDK 集的路径。否则,它只是查找 JRE (jre1.6.0_30)。

注意:JDK 可能会在您的 Java SDK 文件夹中找到。

Please ensure you are using JDK 1.4 or above and
not a JRE
[...]

It might have to do with this line in the error given in your post above. I believe you might want to make sure that you have the path to your JDK set, as well. Otherwise, it's just finding the JRE (jre1.6.0_30).

Note: The JDK might be found in your Java SDK folder.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文