"main" java.lang.ClassNotFoundException: WordCount

0 votes

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 21 in Big Data Hadoop by digger
• 27,620 points
103 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 21 by Omkar
• 67,120 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,050 points
635 views
0 votes
1 answer

Exception in thread "main" java.lang.UnsupportedClassVersionError

Try removing the / before the input ...READ MORE

answered 5 days ago in Big Data Hadoop by Kriti
11 views
0 votes
1 answer

Hadoop Pig: java.lang.NoClassDefFoundError: org/apache/hadoop/hbase/filter/Filter

This seems like a problem with the ...READ MORE

answered Nov 16, 2018 in Big Data Hadoop by Omkar
• 67,120 points
153 views
0 votes
1 answer

Hadoop: java.lang.IllegalArgumentException: Wrong FS: expected: file:///

Try this: Configuration configuration = new Configuration(); FileSystem fs ...READ MORE

answered Dec 12, 2018 in Big Data Hadoop by Omkar
• 67,120 points
381 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,110 points
2,049 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,110 points
196 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
10,482 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,240 points
764 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
• 67,120 points
702 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 in Big Data Hadoop by Omkar
• 67,120 points
957 views