Support Questions

Find answers, ask questions, and share your expertise
Celebrating as our community reaches 100,000 members! Thank you!

Exception in thread "main" java.lang.ClassNotFoundException: WordCount / in Hadoop

New Contributor

I have created 'WordCount.JAR' file and executed the WordCount Program in java using jar file but i am getting exception .

hadoop@ubuntu:~/workspace$ hadoop jar WordCount.JAR WordCount siva/file1.txt Warning: $HADOOP_HOME is deprecated. Exception in thread "main" java.lang.ClassNotFoundException: WordCount at$ at$ at Method) at at java.lang.ClassLoader.loadClass( at java.lang.ClassLoader.loadClass( at java.lang.Class.forName0(Native Method) at java.lang.Class.forName( at org.apache.hadoop.util.RunJar.main(


Master Mentor

@gopi seelam

The "WordCount" program is written with java "package" instruction ? If yes then you should pass the fully qualified classname.

- In order to verify it can you please share the output of the following command this will help us in knowing if you are passing the correct classname there?

jar  -tvf  WordCount.JAR


Also please check if your Jar file name is in Uppercase or lowercase? Like "WordCount.JAR" Or "WordCount.jar"

If the jar file name is in lowercase then you should pass the correct file name in same case.

$ hadoop jar WordCount.jar WordCount siva/file1.txt