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, 2019 in Big Data Hadoop by slayer
• 29,370 points
937 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,

2) Create a jar file of this program,

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

You can see that it works without error.

answered Jan 18, 2019 by Omkar
• 69,220 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, 2019 in Big Data Hadoop by Rishi
714 views
0 votes
1 answer

Error running hadoop mapreduce in Python using Hadoop Streaming

Hi As you write mapper and reducer program  ...READ MORE

answered Jan 21, 2020 in Big Data Hadoop by anonymous
2,588 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, 2019 in Big Data Hadoop by Omkar
• 69,220 points
1,295 views
–1 vote
1 answer

Hadoop MapReduce word count program failed

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

answered Jan 21, 2019 in Big Data Hadoop by Omkar
• 69,220 points
1,404 views
+1 vote
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
• 11,380 points
11,075 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
• 11,380 points
2,572 views
+2 votes
11 answers

hadoop fs -put command?

Hi, You can create one directory in HDFS ...READ MORE

answered Mar 16, 2018 in Big Data Hadoop by nitinrawat895
• 11,380 points
109,062 views
–1 vote
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,350 points
4,640 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
• 69,220 points
508 views
0 votes
1 answer

Issue While Running Oozie Sample Project

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

answered Jan 4, 2019 in Big Data Hadoop by Omkar
• 69,220 points
890 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP