title: Hadoop: unsupported major.minor version 52.0
body: <p>Before you read my question, you should know that it's not a duplicate to all other similar questions on Stackoverflow that I already read!</p>
  
  <p>I've developed (and built and compiled) a Hadoop program on <code>Windows 10</code> (development machine) using Eclipse. The program reads WARC files and rewrite them in JSON format. It uses <a href="http://www.lemurproject.org/clueweb09/workingWithWARCFiles.php#Classes_for_Hadoop" rel="nofollow noreferrer">these classes to override the Writable format</a>:</p>
  
  <pre><code>WarcFileInputFormat.java
  WarcFileRecordReader.java
  WritableWarcRecord.java 
  </code></pre>
  
  <p>I added <code>hadoop- 2.6.0</code> jars files to my project.
  This is the java version of <strong>development machine</strong>:</p>
  
  <pre><code>$java -version
  java version "1.8.0_151"
  Java(TM) SE Runtime Environment (build 1.8.0_151-b12)
  Java HotSpot(TM) 64-Bit Server VM (build 25.151-b12, mixed mode)
  </code></pre>
  
  <p>I tested my code on <code>Ubuntu 14</code> machine (testing machine) and it just worked perfectly. this machine has <code>hadoop- 2.6.0</code>:</p>
  
  <pre><code>Hadoop 2.6.0
  Subversion https://git-wip-us.apache.org/repos/asf/hadoop.git -r e3496499ecb8d220fba99dc5ed4c99c8f9e33bb1
  Compiled by jenkins on 2014-11-13T21:10Z
  Compiled with protoc 2.5.0
  From source with checksum 18e43357c8f927c0695f1e9522859d6a
  This command was run using /home/username/hadoop-2.6.0/share/hadoop/common/hadoop-common-2.6.0.jar
  </code></pre>
  
  <p>This is the java version of <strong>testing machine</strong>:</p>
  
  <pre><code>java version "1.8.0_91"
  Java(TM) SE Runtime Environment (build 1.8.0_91-b14)
  Java HotSpot(TM) 64-Bit Server VM (build 25.91-b14, mixed mode)
  </code></pre>
  
  <p>I moved to a CentOS oracle server and ran my program. This server has the <strong>same java version as my development machine</strong>:</p>
  
  <pre><code>java version "1.8.0_151"
  Java(TM) SE Runtime Environment (build 1.8.0_151-b12)
  Java HotSpot(TM) 64-Bit Server VM (build 25.151-b12, mixed mode)
  </code></pre>
  
  <p>and it had this Hadoop version:</p>
  
  <pre><code>Hadoop 2.6.0-cdh5.13.1
  Subversion http://github.com/cloudera/hadoop -r 0061e3eb8ab164e415630bca11d299a7c2ec74fd
  Compiled by jenkins on 2017-11-09T16:37Z
  Compiled with protoc 2.5.0
  From source with checksum 16d5272b34af2d8a4b4b7ee8f7c4cbe
  This command was run using /opt/cloudera/parcels/CDH-5.13.1-1.cdh5.13.1.p0.2/jars/hadoop-common-2.6.0-cdh5.13.1.jar
  </code></pre>
  
  <p>On this server I got the following error for each job:</p>
  
  <pre><code>18/02/23 11:59:45 INFO mapreduce.Job: Task Id : attempt_1517308433710_0012_m_000003_0, Status : FAILED
  Error: data/warc/WarcFileInputFormat : Unsupported major.minor version 52.0
  </code></pre>
  
  <p><strong>Here are the things I tried and they didn't work</strong>:</p>
  
  <ol>
  <li>Adding the WARC readers' classes to my project as classes not as a jar to build them using the correct java version.</li>
  <li>Changing Hadoop jar files version from <code>hadoop- 2.6.0</code> to <code>hadoop- 2.6.0-cdh5.13.1</code></li>
  <li>Using <code>mapred</code> instead of <code>mapreduce</code> as the reader classes are using <code>mapred</code> </li>
  </ol>
  
  <p>I'm not sure what exactly causes this issue especially that it points to the class WarcFileInputFormat.java that I didn't write but added to my project from the link I provided above. What surprised me is that the program worked perfectly on <code>Ubuntu</code> machine that has a lower java version, but didn't work on the <code>CentOS</code> server that has the same java version as the <code>Windows</code> development machine!</p>
  
  <p>Any hints?</p>