This is a guideline I used for setting up eclipse for hadoop-0.20.2. Hope it helps.
Setting up eclipse for hadoop: use http://wiki.apache.org/hadoop/EclipseEnvironment page and follow as below: 1. New->Project Wizard -> Java Project - Project Name : hadoop-0.20.2, default output folder: hadoop-0.20.2/build/eclipse-classes. 2. Turn off Project | Build Automatically 3. Follow "Configuring Eclipse to build Hadoop" on above webpage and follow nos. 1,3. In 3, add eclipse-files, compile-core-test, compile-examples, compile-hdfs-classes, compile-mapred-classes, jar, examples 4. Follow no. 5 in "Configuring Eclipse to build Hadoop". 5. Right click on project hadoop-0.20.2 -> Build path -> Configure build path. Under "Builders tab, unselect Java Builder, Hit New... Select Ant Builder and press OK. Edit configuration dialog box will open up. Now select different tabs and set the following: a) Name: ant_builder b) Main: Buildfile: ${workspace_loc:/hadoop-0.20.2/build.xml} c) Targets: After a "Clean": compile, eclipse-files, compile-core-test, compile-examples, compile-hdfs-classes, compile-mapred-classes, jar, examples d) Targets: Manual Build: compile, eclipse-files, compile-core-test, compile-examples, compile-hdfs-classes, compile-mapred-classes, jar, examples e) JRE: Separate JRE: java-6-sun or your java directory. f) Hit Apply and OK. 6. Select Project | Build Project. Check the console, the project should build, compile correctly and generate jar files in the build directory. 7. If it gives some .eclipse.templates error, comment out the following lines in build.xml (lines 1606 - 1613) <!-- <copy todir="." overwrite="true"> <fileset dir=".eclipse.templates"> <exclude name="**/README.txt"/> </fileset> <filterset> <filter token="PROJECT" value="${eclipse.project}"/> </filterset> </copy> --> 8. Now it should compile correctly by clicking on Project->Build Project 9. To compile and run a project locally (no hdfs), right-click on your project hadoop-0.20.2, click Run As .. Run Configurations Under Java Application, Hit New. Main tab: Project hadoop-0.20.2 Main class: org.apache.hadoop.examples.ExampleDriver Arguments tab: Project arguments kmeans_itertxt -m 1-r 1 /home/hadoop1/input_files/kmeans.txt /home/hadoop1/work/out1 VM arguments: -Xmx512m For java heap space issues, change hadoop-env.sh, max heap size variable, and in mapred-site.xml, set mapred.child.java.opts appropriately. -Xms512m -Xmx2048m -server Also in ~/.bashrc, export ANT_OPTS="-Xmx2048m" JRE tab: Runtime JRE: Project JRE ClassPath tab: make sure JRE system library and hadoop-0.20.2 both are there. Common tab: Save as : local file Display in favourites menu: click debug and run