Build Hadoop Eclipse Plug-in Jar From Source Code And Install That Plug-in In Eclipse IDE
Hadoop Eclipse plug-in (installed in Eclipse IDE or Spring Tool Suite) eases the experience of Map/Reduce on Hadoop. Hadoop distribution does not include Hadoop Eclipse plug-in jar, but includes source code of that plug-in.
In this post, we'll see all the steps to build Hadoop eclipse plug-in from source code and install that plug-in in Eclipse / Spring Tool Suite to access Hadoop Environment in "Map/Reduce" perspective of the IDE.
Tools and Technologies used in this article :
Navigate to <Hadoop-Installation-Directory>/src/contrib/eclipse-plugin. Following highlighted files will be modified.
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
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.
Now, Eclipse environment for Hadoop is ready for you to explore.