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 ログには、パスが JRE だけでなく JDK を指す必要があることが明確に示されています。だから試してみてください

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