user2956825
user2956825

Reputation: 1

Hadoop getting error Exception in thread "main" java.lang.NoClassDefFoundError:

I am very new to hadoop and map reduce programing. I downloaded version 1.2.1 and was trying to see some example with command

bin/hadoop jar hadoop*example*.jar

with this command I am getting exception. What is wrong here? is there any problem with installation?

Exception in thread "main" java.lang.NoClassDefFoundError: 1/2/1/hadoop-1/2/1/libexec////logs
Caused by: java.lang.ClassNotFoundException: 1.2.1.hadoop-1.2.1.libexec....logs
    at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:315)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:330)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:250)
    at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:398)

Upvotes: 0

Views: 1510

Answers (1)

luish
luish

Reputation: 121

The right command is:

bin/hadoop jar hadoop-*-examples.jar <program name>

If you are using your custom map reduce class, try the following configuration on main method:

job.setJarByClass(WordCount.class);

Reference: http://mydailylearningblog.blogspot.com.br/2011/06/javalangclassnotfoundexception.html

Upvotes: 1

Related Questions