Java incompatibility

Hi I compiled the WordCount program in Windows 7 environment.

C:\Users\101264>java -version
java version "1.6.0_27"
Java(TM) SE Runtime Environment (build 1.6.0_27-b07)
Java HotSpot(TM) 64-Bit Server VM (build 20.2-b06, mixed mode)

But I am getting the following error for CDH3.

cloudera@cloudera-vm:~/class3$ hadoop jar myWordcount.jar com.eng.demo.WordCount /user/cloudera/class3/wc-input /user/cloudera/class3/wc-output

Exception in thread "main" java.lang.UnsupportedClassVersionError: com/eng/demo/WordCount : Unsupported major.minor version 52.0
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClassCond(
at java.lang.ClassLoader.defineClass(
at Method)
at java.lang.ClassLoader.loadClass(
at java.lang.ClassLoader.loadClass(
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(
at org.apache.hadoop.util.RunJar.main(

cloudera@cloudera-vm:~/class3$ java -version
java version "1.6.0_24"
Java(TM) SE Runtime Environment (build 1.6.0_24-b07)
Java HotSpot(TM) Client VM (build 19.1-b02, mixed mode, sharing)

2 Answer(s)


Straight forward, java in cdh3 is different version To that od default environment in eclipse. You will have a feature in eclipse (windows 7) to set environment to required version.


hi Muralushanar,
Looks like there is a difference between the java you used for compilation and the java with which you are trying to execute. Please look here ->

Solution is to update to latest java 7 , use it to compile and execute it. Also note that CDH3 is not supported, better to upgrade to CDH4.