title: Error running project in eclipse wtih maven "Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile"
body: <p>I'm learning google app engine programs with eclipse and maven but I've been stuck on this error since 2 days. I've looked everywhere on the internet but couldn't get a solution to my problem.</p>
  
  <p>Here's the console output</p>
  
  <pre><code>[INFO] Scanning for projects...
  [INFO]                                                                         
  [INFO] ------------------------------------------------------------------------
  [INFO] Building helloworld 1.0-SNAPSHOT
  [INFO] ------------------------------------------------------------------------
  [INFO] 
  [INFO] &gt;&gt;&gt; appengine-maven-plugin:1.9.4:devserver (default-cli) &gt; package @ helloworld &gt;&gt;&gt;
  [INFO] 
  [INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ helloworld ---
  [INFO] Using 'UTF-8' encoding to copy filtered resources.
  [INFO] skip non existing resourceDirectory /Users/AdioJack/Developer/Scalable Apps (Udacity)/ud859-master/Lesson_2/000_Hello_Endpoints/src/main/resources
  [INFO] 
  [INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ helloworld ---
  [INFO] Changes detected - recompiling the module!
  [INFO] Compiling 3 source files to /Users/AdioJack/Developer/Scalable Apps (Udacity)/ud859-master/Lesson_2/000_Hello_Endpoints/target/helloworld-1.0-SNAPSHOT/WEB-INF/classes
  [INFO] ------------------------------------------------------------------------
  [INFO] BUILD FAILURE
  [INFO] ------------------------------------------------------------------------
  [INFO] Total time: 2.462 s
  [INFO] Finished at: 2014-09-10T12:34:38+05:30
  [INFO] Final Memory: 6M/81M
  [INFO] ------------------------------------------------------------------------
  [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project helloworld: Fatal error compiling: invalid target release: 1.7 -&gt; [Help 1]
  [ERROR] 
  [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
  [ERROR] Re-run Maven using the -X switch to enable full debug logging.
  [ERROR] 
  [ERROR] For more information about the errors and possible solutions, please read the following articles:
  [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
  </code></pre>
  
  <p>and here's the pom.xml</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"&gt;
  
      &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
      &lt;packaging&gt;war&lt;/packaging&gt;
      &lt;version&gt;1.0-SNAPSHOT&lt;/version&gt;
  
      &lt;groupId&gt;com.google.training.helloworld&lt;/groupId&gt;
      &lt;artifactId&gt;helloworld&lt;/artifactId&gt;
  
      &lt;properties&gt;
          &lt;appengine.app.version&gt;1&lt;/appengine.app.version&gt;
          &lt;project.build.sourceEncoding&gt;UTF-8&lt;/project.build.sourceEncoding&gt;
      &lt;/properties&gt;
  
      &lt;prerequisites&gt;
          &lt;maven&gt;3.1.0&lt;/maven&gt;
      &lt;/prerequisites&gt;
  
      &lt;dependencies&gt;
          &lt;!-- Compile/runtime dependencies --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;com.google.appengine&lt;/groupId&gt;
              &lt;artifactId&gt;appengine-api-1.0-sdk&lt;/artifactId&gt;
              &lt;version&gt;1.9.4&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;com.google.appengine&lt;/groupId&gt;
              &lt;artifactId&gt;appengine-endpoints&lt;/artifactId&gt;
              &lt;version&gt;1.9.4&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;javax.servlet&lt;/groupId&gt;
              &lt;artifactId&gt;servlet-api&lt;/artifactId&gt;
              &lt;version&gt;2.5&lt;/version&gt;
              &lt;scope&gt;provided&lt;/scope&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;javax.inject&lt;/groupId&gt;
              &lt;artifactId&gt;javax.inject&lt;/artifactId&gt;
              &lt;version&gt;1&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;!-- Test Dependencies --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;junit&lt;/groupId&gt;
              &lt;artifactId&gt;junit&lt;/artifactId&gt;
              &lt;version&gt;4.11&lt;/version&gt;
              &lt;scope&gt;test&lt;/scope&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;com.google.appengine&lt;/groupId&gt;
              &lt;artifactId&gt;appengine-testing&lt;/artifactId&gt;
              &lt;version&gt;1.9.4&lt;/version&gt;
              &lt;scope&gt;test&lt;/scope&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;com.google.appengine&lt;/groupId&gt;
              &lt;artifactId&gt;appengine-api-stubs&lt;/artifactId&gt;
              &lt;version&gt;1.9.4&lt;/version&gt;
              &lt;scope&gt;test&lt;/scope&gt;
          &lt;/dependency&gt;
      &lt;/dependencies&gt;
  
      &lt;build&gt;
          &lt;!-- for hot reload of the web application--&gt;
          &lt;outputDirectory&gt;${project.build.directory}/${project.build.finalName}/WEB-INF/classes&lt;/outputDirectory&gt;
          &lt;plugins&gt;
              &lt;plugin&gt;
                  &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
                  &lt;version&gt;3.1&lt;/version&gt;
                  &lt;artifactId&gt;maven-compiler-plugin&lt;/artifactId&gt;
                  &lt;configuration&gt;
                      &lt;source&gt;1.7&lt;/source&gt;
                      &lt;target&gt;1.7&lt;/target&gt;
                  &lt;/configuration&gt;
              &lt;/plugin&gt;
              &lt;plugin&gt;
                  &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
                  &lt;artifactId&gt;maven-war-plugin&lt;/artifactId&gt;
                  &lt;version&gt;2.4&lt;/version&gt;
                  &lt;configuration&gt;
                      &lt;webXml&gt;${project.build.directory}/generated-sources/appengine-endpoints/WEB-INF/web.xml&lt;/webXml&gt;
                      &lt;webResources&gt;
                          &lt;resource&gt;
                              &lt;!-- this is relative to the pom.xml directory --&gt;
                              &lt;directory&gt;${project.build.directory}/generated-sources/appengine-endpoints&lt;/directory&gt;
                              &lt;!-- the list has a default value of ** --&gt;
                              &lt;includes&gt;
                                  &lt;include&gt;WEB-INF/*.discovery&lt;/include&gt;
                                  &lt;include&gt;WEB-INF/*.api&lt;/include&gt;
                              &lt;/includes&gt;
                          &lt;/resource&gt;
                      &lt;/webResources&gt;
                  &lt;/configuration&gt;
              &lt;/plugin&gt;
              &lt;plugin&gt;
                  &lt;groupId&gt;com.google.appengine&lt;/groupId&gt;
                  &lt;artifactId&gt;appengine-maven-plugin&lt;/artifactId&gt;
                  &lt;version&gt;1.9.4&lt;/version&gt;
                  &lt;configuration&gt;
                      &lt;enableJarClasses&gt;false&lt;/enableJarClasses&gt;
                      &lt;!-- Comment in the below snippet to bind to all IPs instead of just localhost --&gt;
                      &lt;!-- address&gt;0.0.0.0&lt;/address&gt;
                      &lt;port&gt;8080&lt;/port --&gt;
                      &lt;!-- Comment in the below snippet to enable local debugging with a remove debugger
                           like those included with Eclipse or IntelliJ --&gt;
                      &lt;!-- jvmFlags&gt;
                        &lt;jvmFlag&gt;-agentlib:jdwp=transport=dt_socket,address=8000,server=y,suspend=n&lt;/jvmFlag&gt;
                      &lt;/jvmFlags --&gt;
                  &lt;/configuration&gt;                
                  &lt;executions&gt;
                      &lt;execution&gt;
                          &lt;goals&gt;
                              &lt;goal&gt;endpoints_get_discovery_doc&lt;/goal&gt;
                          &lt;/goals&gt;
                      &lt;/execution&gt;
                  &lt;/executions&gt;
  
              &lt;/plugin&gt;
          &lt;/plugins&gt;
      &lt;/build&gt;
  
  &lt;/project&gt;
  </code></pre>
  
  <p>Here's java &amp; maven version information</p>
  
  <pre><code>Apache Maven 3.2.3 (33f8c3e1027c3ddde99d3cdebad2656a31e8fdf4; 2014-08-12T02:28:10+05:30)
  Maven home: /usr/local/Cellar/maven/3.2.3/libexec
  Java version: 1.8.0_20, vendor: Oracle Corporation
  Java home: /Library/Java/JavaVirtualMachines/jdk1.8.0_20.jdk/Contents/Home/jre
  Default locale: en_US, platform encoding: UTF-8
  OS name: "mac os x", version: "10.10", arch: "x86_64", family: "mac"
  </code></pre>
  
  <p>This question is different from 
  <a href="https://stackoverflow.com/questions/19654557/how-to-set-specific-java-version-to-maven">How to set specific java version to Maven</a></p>
  
  <p>I've only 1 version of java installed i.e. JDK 8</p>
  
  <p>This is the command I ran in terminal to make maven is using latest java version</p>
  
  <pre><code>export JAVA_HOME=$(/usr/libexec/java_home)
  </code></pre>