main java lang ClassNotFoundException WordCount

–1 vote

When I am run the jar of wordcount using this command:

 hadoop jar hadoop-prog.jar WordCount /home/temp/input /home/temp/output

it always shows this error :

   Exception in thread "main" java.lang.ClassNotFoundException: WordCount
    at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:247)
    at org.apache.hadoop.util.RunJar.main(RunJar.java:149)

This is a simple program but I am not able to run. I have not made any changes. Please help me solve this.

Jan 22, 2019 in Big Data Hadoop by digger
• 26,740 points
4,567 views

1 answer to this question.

0 votes

When you are running a jar file in Hadoop, you have to mention the whole package name. The syntax is as follows:

hadoop jar wordcount.jar com.something.WordCount /home/temp/input /home/temp/output
answered Jan 22, 2019 by Omkar
• 69,220 points

Related Questions In Big Data Hadoop

0 votes
1 answer

Hadoop Java Error: java.lang.NoClassDefFoundError: WordCount (wrong name: org/myorg/WordCount)

Hey, try this code import java.io.IOException; import java.util.Iterator; import java.util.StringTokenizer; import ...READ MORE

answered Sep 19, 2018 in Big Data Hadoop by slayer
• 29,370 points
6,181 views
0 votes
2 answers

Exception in thread "main" java.lang.UnsupportedClassVersionError

Hi, keep in mind do not forget to ...READ MORE

answered Aug 5, 2019 in Big Data Hadoop by Rashi
1,409 views
+1 vote
2 answers

Hadoop: Error: Exception in thread “main” java.lang.UnsupportedClassVersionError: a

The reason for this error is because ...READ MORE

answered Aug 6, 2019 in Big Data Hadoop by Venkita
• 240 points
1,870 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,029 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,538 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
108,836 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,612 views
0 votes
1 answer

Hadoop: "Caused by: java.lang.ClassNotFoundException" error

Have you placed the jar files in ...READ MORE

answered Nov 19, 2018 in Big Data Hadoop by Omkar
• 69,220 points
7,005 views
0 votes
1 answer

Spark : java.lang.ClassNotFoundException: org.apache.hadoop.fs.FSDataInputStream

Create a spark-env.cmd file looking like this @echo off set ...READ MORE

answered Jan 2, 2019 in Big Data Hadoop by Omkar
• 69,220 points
11,967 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