title: Unsupported major.minor version 51.0 but everything is set to JDK 1.6
body: <p>I have a Maven Eclipse application which I'm trying to run through the command prompt using the following command:</p>
  
  <pre><code>java -cp target/classes;"target/dependency/*" com.example.Main
  </code></pre>
  
  <p>Unfortunately, it throws an error:</p>
  
  <pre><code>UnsupportedClassVersionError : unsupported major.minor version 51.0
  </code></pre>
  
  <p>I did some digging and found out it has something to do with the application being compiled on a JDK of a newer version, than the JRE it runs on. Apparently the 51 means it was built for 1.7, but I don't have a JDK 7 on my computer...</p>
  
  <p>So I made sure that everything is set to version 1.6 :</p>
  
  <p>system.properties file in the root contains</p>
  
  <pre><code>java.runtime.version=1.6
  </code></pre>
  
  <p>Added the maven property </p>
  
  <pre><code>&lt;java.version&gt;1.6&lt;/java.version&gt;
  </code></pre>
  
  <p>Specified the maven compiler plugin in my pom.xml</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;2.1&lt;/version&gt;
      &lt;configuration&gt;
          &lt;source&gt;1.6&lt;/source&gt;
          &lt;target&gt;1.6&lt;/target&gt;
      &lt;/configuration&gt;
  &lt;/plugin&gt;
  </code></pre>
  
  <p>I checked the version of my java using the command java -version which returned</p>
  
  <pre><code>Java version "1.6.0_38"
  Java(TM) SE Runtime Environment (build 1.6.0_38-b05)
  Java HotSpot(TM) 64-bit Server VM (build 20.13-b02, mixed mode)
  </code></pre>
  
  <p>And an update of my project after setting the maven-compiler-plugin resulted in Eclipse automatically setting the compiler level to 1.6, the project facet level to 1.6 and adding the JavaSE-1.6 jre system library to my project.</p>
  
  <p>So I have absolutely no idea where this JDK 1.7 is coming from. I never installed JDK 1.7 on this computer to begin with...</p>
  
  <p>Also, originally, the maven-compiler-plugin wasn't present so it was build with 1.5 I guess. But I did a <code>mvn clean install</code>,  then a <code>mvn package</code>, and then tried the command again after all the settings were adjusted and it still throws the same error.</p>