hadoop-mapreduce-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ratner, Alan S (IS)" <Alan.Rat...@ngc.com>
Subject RE: noobie question on hadoop's NoClassDefFoundError
Date Tue, 17 Nov 2009 18:12:45 GMT
I get a similar "NoclassDefFoundError" but it doesn't involve Eclipse.
I have downloaded Hadoop 18.3, 19.1 and 20.1 and have gotten 18 and 19
to run on top of Cygwin.  But 20.1 doesn't seem to be able to find Java,
reports an exception in thread "main" java.lang.NoclassDefFoundError
and dies with the unhelpful message: "Could not find the main class:
and.  Program will exit."


I have attached an image showing that the identical command (simply
invoking bin/hadoop namenode -format) works in 18.3 and does not work in
20.1.  Does know why 20.1 differs this way from 18 and 19?


Alan Ratner



From: Jason Venner [mailto:jason.hadoop@gmail.com] 
Sent: Tuesday, November 17, 2009 1:26 AM
To: mapreduce-user@hadoop.apache.org
Subject: Re: noobie question on hadoop's NoClassDefFoundError


Your eclipse instance doesn't have the jar files in the lib directory of
your hadoop installation in the class path.

On Sat, Nov 14, 2009 at 7:51 PM, felix gao <gre1600@gmail.com> wrote:

I wrote a simple code in my eclipse as 

Text t = new Text("hadoop");

when I try to run this I got 

Exception in thread "main" java.lang.NoClassDefFoundError:
    at org.apache.hadoop.io.Text.<clinit>(Text.java:49)
    at com.example.io.WritableIOExample.main(WritableIOExample.java:44)
Caused by: java.lang.ClassNotFoundException:
    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:307)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
    at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
    ... 2 more

The library used are Haddop 0.20.1 and log4j-1.2.15

Thanks for helping

Pro Hadoop, a book to guide you from beginner to hadoop mastery,
www.prohadoopbook.com a community for Hadoop Professionals

View raw message