title: Maven/Jenkins java.lang.UnsupportedClassVersionError: Unsupported major.minor version 51.0
body: <p>I have a  Jenkins server having JDK &amp; JRE 6 and 7 installed together. </p>
  
  <p>All of the projects are built on 1.6 except one which is 1.7 dependent.</p>
  
  <p>I've configured the maven pom file to use the Java compiler from the JAVA_HOME_7 environment PATH.</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.0&lt;/version&gt;
                  &lt;configuration&gt;
                      &lt;source&gt;1.7&lt;/source&gt;
                      &lt;target&gt;1.7&lt;/target&gt;
                      &lt;showDeprecation&gt;true&lt;/showDeprecation&gt;
                      &lt;showWarnings&gt;true&lt;/showWarnings&gt;
                      **&lt;executable&gt;${env.JAVA_HOME_7}/bin/javac&lt;/executable&gt;**
                      &lt;fork&gt;true&lt;/fork&gt;
                      &lt;verbose&gt;false&lt;/verbose&gt;
                  &lt;/configuration&gt;
              &lt;/plugin&gt;
  </code></pre>
  
  <p>During mvn install I'm getting the following error:</p>
  
  <pre><code>java.lang.RuntimeException: There was an error in the forked process
  java.lang.UnsupportedClassVersionError: : Unsupported major.minor version 51.0
  </code></pre>
  
  <p>which I think means that the server is using JRE 1.6.</p>
  
  <p>How to keep the JRE 1.6 together with 1.7 in order to keep the compatibility with the old 1.6 projects and the new 1.7 one?</p>
  
  <p>Many Thanks,
  Atanas </p>