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,040 points
12 views

1 answer to this question.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
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
• 65,850 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 20 hours ago in Big Data Hadoop by Rishi
3 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
• 9,030 points
53 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
• 65,850 points
16 views
0 votes
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
• 65,850 points
32 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
• 9,030 points
1,667 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
• 9,030 points
130 views
0 votes
10 answers

hadoop fs -put command?

copy command can be used to copy files ...READ MORE

answered Dec 7, 2018 in Big Data Hadoop by Sujay
8,092 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
568 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
• 65,850 points
32 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
• 65,850 points
30 views

© 2018 Brain4ce Education Solutions Pvt. Ltd. All rights Reserved.
"PMP®","PMI®", "PMI-ACP®" and "PMBOK®" are registered marks of the Project Management Institute, Inc. MongoDB®, Mongo and the leaf logo are the registered trademarks of MongoDB, Inc.