hadoop source jar

March 8th, 2009
Tags: hadoop jar Posted in Hadoop :-)Say something

When I am using the hadoop jar downloaded from Apache, I couldn't see the source from Eclipse "Declaration" or just simply by mouse over the Class/Function as it gives following error:

Note: This element neither has attached source nor attached Javadoc and hence no Javadoc could be found.

So I took a big effort to download the nightly build and want to create a Hadoop reference project in my Eclipse. However, because of various silly reasons, no success. (I could even create a jar for the core module, but in Eclipse, I still got error, saying the build/test/classes not valid)

Then after hours, I reallized, what I really want is having source file into the jar. So the solution is

cd $HADOOP/src/core; jar uvf ../../hadoop-($version)-core.jar org/
cd $HADOOP/src/mapred; jar uvf ../../hadoop-($version)-core.jar org/

you may also want to have files from src/hdfs (btw, it's interesting Hadoop separates the same pacakge in this way, but no reason you can't do that :) )

Now the hadoop jar file will have the java source and you can view the Hadoop core source in your mapred jobs!

Relate Posts:// 相关文章

xslt preserve entity»
«Setup GWT 1.6

我要留言

5+10=