Tools and Technologies used in this article :

  1. Hadoop 1.2.0

  2. Ant

  3. Spring Tool Suite (STS) 3.2.0

 

Navigate to <Hadoop-Installation-Directory>/src/contrib/eclipse-plugin. Following highlighted files will be modified.

Overall Directory structure of Hadoop Installation

 

1. Try Ant Build

Lets us first see, what happens if we try to build Hadoop Eclipse plug-in from the provided source code.

Terminal

Above echo message indicates that eclipse.home is not set and build of the plugin is skipped.

 

2. Modify build.properties

Open build.properties in a text editor and set eclipse.home with your Eclipse / STS installation directory. Also define version of different jars required by Hadoop Eclipse plug-in.

build.properties

 

3. Try Ant Build Once Again

Now eclipse.home is set, but we are not done yet. To find out why, try ant build once again. This time we will get java compilation errors as shown below.

Terminal

 

4. Modify build.xml

Open build.xml and modify path (id="classpath") and target (name="jar") as highlighted below.

build.xml
Note : Hadoop Eclipse Plug-in code is dependent on Hadoop jars. So it is required to add those in classpath of 'compile' target. Also we need to include jars required by the eclipse plugin in 'jar' target.

 

5. Modify MANIFEST.MF

Open MANIFEST.MF in text editor and modify Bundle-ClassPath as highlighted below to incorporate the changes made in build.xml.

META-INF/MANIFEST.MF

 

6. Build Hadoop Eclipse Plug-in

Execute ant jar or ant clean package. On successful build, Hadoop Eclipse Plug-in jar (hadoop-eclipse-plugin-1.2.0.jar) will be created inside <Hadoop-Installation-Directory>/build/contrib/eclipse-plugin/

Terminal

 

7. Install Hadoop Eclipse Plug-in

Copy Hadoop Eclipse Plug-in jar (hadoop-eclipse-plugin-1.2.0.jar) and paste it to <Eclipse-Installation-Directory>/plugins directory. Start / Restart (if already running) Eclipse / Spring Tool Suite IDE.

 

8. Check Hadoop Eclipse Plug-in

Navigate Window --> Open Perspective --> Other and select Map/ReduceOpen perspective. You'll be able to see Map/Reduce Locations window where New Hadoop Location can be added.

Map/Reduce Locations

New Hadoop Location

Now, Eclipse environment for Hadoop is ready for you to explore.

 

References