hadoop 执行wordcount时报错Unsupported major.minor version 52.0

打jar包,上传集群,执行时报错如下:

[root@master hadoop]# hadoop jar wordCount.jar test.myDrive ./trainData.csv /tmp/wordcount

Exception in thread "main" java.lang.UnsupportedClassVersionError: test/myDriver : Unsupported major.minor version 52.0
        at java.lang.ClassLoader.defineClass1(Native Method)
        at java.lang.ClassLoader.defineClass(ClassLoader.java:800)
        at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
        at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)
        at java.net.URLClassLoader.access$100(URLClassLoader.java:71)
        at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
        at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(Class.java:274)
        at org.apache.hadoop.util.RunJar.run(RunJar.java:214)

        at org.apache.hadoop.util.RunJar.main(RunJar.java:136)


百度一下,大致说是JDK版本不一致的问题

检查测试环境:

集群:hadoop 2.6.0 + jdk 1.7

开发环境:eclipse Mars.1 + jdk 1.8

调整eclipse中的jdk为1.7, 再打包测试,问题解决。



你可能感兴趣的:(hadoop 执行wordcount时报错Unsupported major.minor version 52.0)