0

Im trying to run a maven project on a Ubuntu machine, but its unable to find Java

 Compilation failure
Unable to locate the Javac Compiler in:
  /usr/lib/jvm/java-6-openjdk/jre/../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.

this is my etc/environment file

PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:u$
JAVA_HOME=”/usr/lib/jvm/java-6-openjdk/jre”
M2_HOME=”/usr/local/apache-maven/apache-maven-3.1.0″
MAVEN_HOME=”/usr/local/apache-maven/apache-maven-3.1.0″
M2=”/usr/local/apache-maven/apache-maven-3.1.0/bin”

What additional information could i provide in order to make my question more clear?

4

1 回答 1

2

我想这JAVA_HOME="/usr/lib/jvm/java-6-openjdk/jre"就是问题所在。Maven 日志清楚地表明您的路径应该指向 JDK 而不仅仅是 JRE。所以试试

export JAVA_HOME=/usr/lib/jvm/java-6-openjdk
于 2013-09-05T10:51:25.427 回答