title: Maven: Fatal error compiling: invalid target release: 1.8
body: <p>We just upgraded the project from <code>jdk 1.6</code> to <code>jdk 1.8</code>. While building the project in my machine, i'm getting following error.</p>
  
  <blockquote>
    <p>[ERROR] Failed to execute goal
    org.apache.maven.plugins:maven-compiler-plugin:3.3:compile
    (default-compile) on project exception: Fatal error compiling: invalid
    target release: 1.8 -> [Help 1]</p>
  </blockquote>
  
  <p>Here is the maven compiler plugin which is been used</p>
  
  <pre><code> &lt;plugin&gt;
      &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
      &lt;artifactId&gt;maven-compiler-plugin&lt;/artifactId&gt;
      &lt;version&gt;3.3&lt;/version&gt;
      &lt;configuration&gt;
          &lt;source&gt;1.8&lt;/source&gt;
          &lt;target&gt;1.8&lt;/target&gt;
          &lt;/configuration&gt;
    &lt;/plugin&gt;
  </code></pre>
  
  <p>I looked at the many post and most of them were related with not having the correct version configured for java_home. I verified all of these aspects and couldn't find any of them alarming.</p>
  
  <p>Java version -</p>
  
  <pre><code> qadeersmsiphone:main pdubey$ java -version
   java version "1.8.0_51"
   Java(TM) SE Runtime Environment (build 1.8.0_51-b16)
   Java HotSpot(TM) 64-Bit Server VM (build 25.51-b03, mixed mode)
  </code></pre>
  
  <p>Maven Version -</p>
  
  <pre><code>qadeersmsiphone:main pdubey$ mvn -version
  Apache Maven 3.1.1 (0728685237757ffbf44136acec0402957f723d9a; 2013-09-17 08:22:22-0700)
  Maven home: /usr/share/maven
  Java version: 1.8.0_51, vendor: Oracle Corporation
  Java home: /Library/Java/JavaVirtualMachines/jdk1.8.0_51.jdk/Contents/Home/jre
  Default locale: en_US, platform encoding: UTF-8
  OS name: "mac os x", version: "10.8.5", arch: "x86_64", family: "mac"
  </code></pre>
  
  <p>and I checked that while building the project maven uses jdk 1.8</p>
  
  <pre><code>qadeersmsiphone:main pdubey$ mvn install -debug
  Apache Maven 3.1.1 (0728685237757ffbf44136acec0402957f723d9a; 2013-09-17 08:22:22-0700)
  Maven home: /usr/share/maven
  Java version: 1.8.0_51, vendor: Oracle Corporation
  Java home: /Library/Java/JavaVirtualMachines/jdk1.8.0_51.jdk/Contents/Home/jre
  Default locale: en_US, platform encoding: UTF-8
  OS name: "mac os x", version: "10.8.5", arch: "x86_64", family: "mac"
  [INFO] Error stacktraces are turned on.
  [DEBUG] Reading global settings from /usr/share/maven/conf/settings.xml
  [DEBUG] Reading user settings from /Users/pdubey/.m2/settings.xml
  [DEBUG] Using local repository at /Users/pdubey/.m2/repository
  [DEBUG] Using manager EnhancedLocalRepositoryManager with priority 10.0 for  /Users/pdubey/.m2/repository
  [INFO] Scanning for projects...
  </code></pre>
  
  <blockquote>
    <p><strong>UPDATE:</strong>  I could get it working by removing the
    maven-compiler-plugin in pom file (Ideally, i don't want to do this). And i also observed that even if i
    remove this plugin, maven by default downloads the 3.3 version of
    compiler plugin in my local repo. I'm not sure what's wrong in this
    plugin although source and target appears to be correct.</p>
  </blockquote>