Question

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?

Was it helpful?

Solution

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top