Tuesday, December 11, 2012

Import hadoop with Eclipse

Eclipse is a good tool for study hadoop code. But it may takes a while to resolve all the links, make tool tip  and declaration jump work.

Here are steps:

1. create a java proj, using j2SE1.5 as your jre (to date it's the highest j2SE you can find in eclipse);
2. symlink src to src in hadoop
3. select proj->Build Path->configure build path, go to library tab
4. click "Add external JARs", and all jars from hadoop dir and lib dir
5. Switch to "Order and Export", check all hadoop-*.jars, click OK
6. select proj -> Refresh

That's it.

When you try to dereference a declaration of a obj, it may prompts you to "Attach file". Just attach to src folder should solve the problem.

 

No comments:

Post a Comment