When I try to compile a project with Maven, I get the following error:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project webserverlog: Compilation failure [ERROR] No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK? [ERROR] -> [Help 1] org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project webserverlog: Compilation failure No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?
My JAVA_HOME points to the JDK:
$ echo $JAVA_HOME /System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK/Home $ $JAVA_HOME/bin/javac -version javac 1.7.0_25 javac: no source files Usage: javac <options> <source files>
I'm not sure why Maven appends '/ jre' to the end of JAVA_HOME, but looking at some other posts this doesn't seem to be a problem:
$ mvn --version Apache Maven 3.0.4 (r1232337; 2012-01-17 18:44:56+1000) Maven home: /Users/jerry/dev/springsource/apache-maven-3.0.4 Java version: 1.7.0_25, vendor: Oracle Corporation Java home: /Library/Java/JavaVirtualMachines/jdk1.7.0_25.jdk/Contents/Home/jre Default locale: en_US, platform encoding: UTF-8 OS name: "mac os x", version: "10.8.4", arch: "x86_64", family: "mac"
I searched for a solution to this problem and tried different things in the last couple of days, but I can not find anything that works. I saw some topics with a similar problem, but none of the suggestions worked for me.
Does anyone know how to solve this? Any help is much appreciated ...
source share