UnsupportedClassVersionError while running Mapreduce program.

0 votes

When I am trying to run Mapreduce program, I am getting UnsupportedClassVersionError error.

Also when I am adding the following line for JOB 

Job job = new Job.getInstance(conf,"WordCount"); 

I am getting the error in my eclipse. To remove the error, I replace the above line with 

Job job = new Job(conf,"WordCount"); 

But for both the cases when I am trying to run the jar I am getting the error mentioned. Below is the Screenshot

Jan 18 in Big Data Hadoop by slayer
• 29,170 points
31 views

1 answer to this question.

0 votes

Seems like the jar file was not exported properly. Did you export the jar by yourself or copied from somewhere? This is one of the many reasons for this error. Anyways, you can follow the below mentioned steps to run the MapReduce program:

1) Write the program in eclipse,

image

2) Create a jar file of this program,

image

image

image

Now, you will have the jar file in the local file system of your System.

3) Make sure that you have the input dataset in the hdfs,

4) Execute the Hadoop jar command.

The syntax to execute the hadoop jar command is as below,

hadoop jar <jarfilename.jar> <packagename.classname> <inputfile> <outputpath>

We will execute the below command for our program,

hadoop jar WordCount.jar co.edureka.WordCount wordcountproblem WordCountOutput

image

This will create a directory in hdfs named WordCountOutput and this directory will contain the output of our program,

5) Check the output.

The syntax to check the contents of a file in hdfs is as below,

hdfs dfs -cat <path/filename>

We will check the output of our program with the below command,

hdfs dfs -cat WordCountOutput/part-r-00000

image

You can see that it works without error.

answered Jan 18 by Omkar
• 67,660 points
Yes. It works. The first time, I used the jar file that I downloaded from the internet.

Related Questions In Big Data Hadoop

0 votes
1 answer

Problem while running MapReduce code.

You will have to create a Mapper ...READ MORE

answered May 23 in Big Data Hadoop by Rishi
54 views
0 votes
0 answers

Error running hadoop mapreduce in Python using Hadoop Streaming

I was trying a sample mapredyce code ...READ MORE

Apr 2, 2018 in Big Data Hadoop by nitinrawat895
• 10,710 points
158 views
0 votes
1 answer

Class not found exception when I am running my Word Count Program jar file

You have forgotten to include the package name ...READ MORE

answered Jan 18 in Big Data Hadoop by Omkar
• 67,660 points
47 views
–1 vote
1 answer

Hadoop MapReduce word count program failed

Seems like Firewall is blocking the connection. ...READ MORE

answered Jan 21 in Big Data Hadoop by Omkar
• 67,660 points
58 views
0 votes
1 answer

Hadoop Mapreduce word count Program

Firstly you need to understand the concept ...READ MORE

answered Mar 16, 2018 in Data Analytics by nitinrawat895
• 10,710 points
3,303 views
0 votes
1 answer

hadoop.mapred vs hadoop.mapreduce?

org.apache.hadoop.mapred is the Old API  org.apache.hadoop.mapreduce is the ...READ MORE

answered Mar 16, 2018 in Data Analytics by nitinrawat895
• 10,710 points
391 views
0 votes
10 answers

hadoop fs -put command?

put syntax: put <localSrc> <dest> copy syntax: copyFr ...READ MORE

answered Dec 7, 2018 in Big Data Hadoop by Aditya
16,283 views
0 votes
1 answer

Hadoop dfs -ls command?

In your case there is no difference ...READ MORE

answered Mar 16, 2018 in Big Data Hadoop by kurt_cobain
• 9,260 points
1,186 views
0 votes
1 answer

Running into an issue while running the mapred job on the server

Try this command hadoop dfs -put /var/tmp/students.txt / hadoop ...READ MORE

answered Dec 20, 2018 in Big Data Hadoop by Omkar
• 67,660 points
50 views
0 votes
1 answer

Issue While Running Oozie Sample Project

Hey @supriya.  Seems like you have not set ...READ MORE

answered Jan 3 in Big Data Hadoop by Omkar
• 67,660 points
68 views