Unable to execute the jar file wordcount.

0 votes

I am trying to execute word count jar file in my system. I am using the following command:

$ hadoop jar WordCountAssignment.jar WordCount /user/hduser/wordcountproblem /user/hduser/wordcountproblemSol

But I am getting this error:

Exception in thread "main" java.lang.ClassNotFoundException: WordCount
        at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(Class.java:348)
        at org.apache.hadoop.util.RunJar.run(RunJar.java:214)
        at org.apache.hadoop.util.RunJar.main(RunJar.java:136)
Jan 21 in Big Data Hadoop by digger
• 27,620 points
53 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

I see that the command that you are using has only input path where your data set is present and an output path but you have not mentioned your package name along with the class name. So, It was unable to locate the class. 

The command is as below for executing map reduce codes:

hadoop jar wc.jar practice.word_count wordcountproblem /user/hduser/wc_mr

Where wc.jar is the name of the jar that you export from eclipse, practice is the name of the package in which we have the class, this can differ if you have a different class name, word_count is the class name in which you have the code for word counting, wordcountproblem is the data set that you have transferred  to hdfs. This may change depending on the exact path of your data set in the hdfs.

answered Jan 21 by Omkar
• 65,820 points

Related Questions In Big Data Hadoop

0 votes
1 answer

Why is jar file required to execute a MR code instead of class file?

We use hadoop keyword to invoke the ...READ MORE

answered Apr 24, 2018 in Big Data Hadoop by Shubham
• 12,110 points
33 views
0 votes
1 answer

Failing to execute the script pig file on HDFS

By convention, the pig script that you ...READ MORE

answered Feb 14 in Big Data Hadoop by John
62 views
0 votes
7 answers

How to run a jar file in hadoop?

I used this command to run my ...READ MORE

answered Dec 10, 2018 in Big Data Hadoop by Dasinto
3,224 views
0 votes
1 answer

Copy file from HDFS to the local file system

There are two possible ways to copy ...READ MORE

answered Mar 27, 2018 in Big Data Hadoop by nitinrawat895
• 9,030 points
2,522 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,639 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
7,954 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
552 views
0 votes
1 answer

Unable to execute HDFS commands on the terminal

Maybe because you have not started hadoop ...READ MORE

answered Feb 6 in Big Data Hadoop by Omkar
• 65,820 points
9 views
0 votes
1 answer

Error while hitting the hadoop jar command to execute my map reduce

Since your jar file was inside the ...READ MORE

answered Feb 11 in Big Data Hadoop by Omkar
• 65,820 points
42 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.