title: UnsupportedClassVersionError on hadoop with no apparent change of version
body: <p>I'm running a hadoop job on my university cluster, which is failing with the following error:</p>
  
  <pre><code>hadoop jar target/SpamClassifier-1.0-SNAPSHOT-jar-with-dependencies.jar &lt;args&gt;
  Exception in thread "main" java.lang.UnsupportedClassVersionError: infolab/social/spam/FeatureApp : Unsupported major.minor version 51.0
      at java.lang.ClassLoader.defineClass1(Native Method)
      at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631)
      at java.lang.ClassLoader.defineClass(ClassLoader.java:615)
      at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
      at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
      at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
      at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
      at java.security.AccessController.doPrivileged(Native Method)
      at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
      at java.lang.Class.forName0(Native Method)
      at java.lang.Class.forName(Class.java:247)
      at org.apache.hadoop.util.RunJar.main(RunJar.java:205)
  </code></pre>
  
  <p>I've done a bit of reading, and it looks like this can be because the jar is compiled with a version of java that is different to the runtime version.  I tried building on the hadoop master itself (because I enjoy the luxury of permissive shell access to the machine), but it was to no avail.</p>
  
  <p><em>Java version:</em></p>
  
  <pre><code>$ java -version
  java version "1.7.0_45"
  Java(TM) SE Runtime Environment (build 1.7.0_45-b18)
  Java HotSpot(TM) 64-Bit Server VM (build 24.45-b08, mixed mode)
  </code></pre>
  
  <p><em>Maven version:</em></p>
  
  <pre><code>Apache Maven 3.1.1 (0728685237757ffbf44136acec0402957f723d9a; 2013-09-17 09:22:22-0600)
  Maven home: /opt/apache-maven-3.1.1
  Java version: 1.7.0_45, vendor: Oracle Corporation
  Java home: /usr/java/jdk1.7.0_45/jre
  Default locale: en_US, platform encoding: UTF-8
  OS name: "linux", version: "2.6.32-431.5.1.el6.x86_64", arch: "amd64", family: "unix"
  </code></pre>
  
  <p><em>Hadoop version (Hortonworks):</em></p>
  
  <pre><code>$ hadoop version
  Hadoop 2.2.0.2.0.6.0-102
  Subversion git@github.com:hortonworks/hadoop.git -r 02ad68f19849a0a986dac36b705491f6791f9179
  Compiled by jenkins on 2014-01-21T00:56Z
  Compiled with protoc 2.5.0
  From source with checksum 66f6c486e27479105979740178fbf0
  This command was run using /usr/lib/hadoop/hadoop-common-2.2.0.2.0.6.0-102.jar
  </code></pre>
  
  <p><em>I am building all of this with maven, and below is the excerpt from my <code>pom.xml</code> that specifies java versioning:</em></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.1&lt;/version&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;
  </code></pre>
  
  <p>I really at a loss.  Could it be that maven is compiling using a different version of java for some reason?  I didn't think we even had a different version installed.</p>