Netty编译错误

时间:2012-02-21 02:18:48

标签: maven netty

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

[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"

有什么想法吗?

1 个答案:

答案 0 :(得分:0)

  

请确保您使用的是JDK 1.4或以上 和   不是JRE [...]

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

注意:JDK可能位于Java SDK文件夹中。