0

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)

1 Answer 1

1

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

Sign up to request clarification or add additional context in comments.

2 Comments

I am still getting the same error. I had tried the same command on version 1.0.4 and was able to see the examples available. But on 1.0.4 even after using setJarByClass() was getting the same error on my modified word count program here i dont have any custom class.
Please post here the command you are using to run a Hadoop example job. See the list of available jobs: stackoverflow.com/a/18811571/1431949

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.