hadoop-mapreduce-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jason Venner <jason.had...@gmail.com>
Subject Re: noobie question on hadoop's NoClassDefFoundError
Date Tue, 17 Nov 2009 06:25:48 GMT
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");
> System.out.println((char)t.charAt(2));
>
> when I try to run this I got
>
> Exception in thread "main" java.lang.NoClassDefFoundError:
> org/apache/commons/logging/LogFactory
>     at org.apache.hadoop.io.Text.<clinit>(Text.java:49)
>     at com.example.io.WritableIOExample.main(WritableIOExample.java:44)
> Caused by: java.lang.ClassNotFoundException:
> org.apache.commons.logging.LogFactory
>     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,
http://www.amazon.com/dp/1430219424?tag=jewlerymall
www.prohadoopbook.com a community for Hadoop Professionals

Mime
View raw message