Support Questions

Find answers, ask questions, and share your expertise
Announcements
Celebrating as our community reaches 100,000 members! Thank you!

Not Valid Jar Error

avatar
Expert Contributor

Hi .

While running wordcount jar I am getting error"Not a valid jar"

[hdfs@sandbox /]$ hadoop fs -ls

Found 8 items

drwx------ - root hdfs 0 2016-08-12 00:21 .Trash

drwxr-xr-x - root hdfs 0 2016-08-01 21:31 .hiveJars

drwx------ - hdfs hdfs 0 2016-08-12 19:42 .staging

-rw-r--r-- 3 admin hdfs 1024 2016-08-14 19:24 count.txt

drwxr-xr-x - hdfs hdfs 0 2016-08-12 18:38 emp

-rw-r--r-- 3 admin hdfs 4096 2016-08-14 19:24 wordcount.jar

[hdfs@sandbox /]$ hadoop jar wordcount.jar WordCount count.txt wordcountoutput

WARNING: Use "yarn jar" to launch YARN applications. Not a valid JAR: /wordcount.jar

I compiled my program with hadoop-common-2.3.0.jar

Hadoop and Java version as below

Hadoop 2.7.1.2.3.2.0-2950

java version "1.7.0_91"

1 ACCEPTED SOLUTION

avatar
Super Guru
@Tech Guy

your latest error is just because of incompatible java version. According to this link:

major version number of the class file format being used.

Java SE 9 = 53 (0x35 hex),[3] Java SE 8 = 52 (0x34 hex), Java SE 7 = 51 (0x33 hex), Java SE 6.0 = 50 (0x32 hex), Java SE 5.0 = 49 (0x31 hex), JDK 1.4 = 48 (0x30 hex), JDK 1.3 = 47 (0x2F hex), JDK 1.2 = 46 (0x2E hex), JDK 1.1 = 45 (0x2D hex).

update your Java to JDK 1.8. This should resolve it. Also look at the following link.

http://stackoverflow.com/questions/22489398/unsupported-major-minor-version-52-0

View solution in original post

10 REPLIES 10

avatar
Super Guru
@Tech Guy

your latest error is just because of incompatible java version. According to this link:

major version number of the class file format being used.

Java SE 9 = 53 (0x35 hex),[3] Java SE 8 = 52 (0x34 hex), Java SE 7 = 51 (0x33 hex), Java SE 6.0 = 50 (0x32 hex), Java SE 5.0 = 49 (0x31 hex), JDK 1.4 = 48 (0x30 hex), JDK 1.3 = 47 (0x2F hex), JDK 1.2 = 46 (0x2E hex), JDK 1.1 = 45 (0x2D hex).

update your Java to JDK 1.8. This should resolve it. Also look at the following link.

http://stackoverflow.com/questions/22489398/unsupported-major-minor-version-52-0