Sunday, June 02, 2013

Create Eclipse(Juno) Plugin for Hadoop



Visit https://github.com/mkamithkumar/hadoop-eclipse-plugins and find if eclipse plugin for your hadoop version is available . If not follow the below to build your own.

Prerequisites:


Steps:

1. Open Eclipse using terminal or dashboard.
2. Under Eclipse, Click File>Import, select General>Existing project into workspace and click Next.
3. Set Select root directory to ${YOUR_HADOOP_HOME}/src/contrib/eclipse-plugin then under Projects select MapReduceTools and click Finish (Make sure you do not check any options in this window like Copy projects into workspace).
4. MapReduceTools project will appear under Project Explorer window. Right click it and select Build Path>Configure Build Path.
5. In opened windows under Java Build Path> Libraries double click hadoop-core-{version}.jar and browse it to ${YOUR_HADOOP_HOME}/hadoop-core-{version}.jar.Click OK to confirm.
6. Now open build.xml under MapReduceTools project and add below lines just after
/*some jar files inclusion*/
7. In build.xml add below line just after .
8. In build.xml replace lines
with

9. Save build.xml and close this file.
10. Now open MANIFEST.MF under MapReduceTools/META-INF folder and replace Bundle-ClassPath: line with below, save it and close this file
Bundle-ClassPath: classes/,
lib/hadoop-core.jar,
lib/commons-cli-1.2.jar,
lib/commons-configuration-1.6.jar,
lib/commons-httpclient-3.0.1.jar,
lib/commons-lang-2.4.jar,
lib/jackson-core-asl-1.8.8.jar,
lib/jackson-mapper-asl-1.8.8.jar



11. To edit another file we have to open Terminal and open file build-contrib.xml
hduser@Hadoop:~$ sudo gedit ${YOUR_HADOOP_HOME}/src/contrib/build-contrib.xml

12. build-contrib.xml add below 2 lines

<!– This is Hadoop Version –>
<!– This is eclipse folder path –>
just after

13. Now move back to Eclipse and right click build.xml file under Project Explorer and click Run As>Ant Build. After successful build the jar file can be obtained from
${YOUR_HADOOP_HOME}/build/contrib/eclipse-plugin folder

14. Copy above compiled jar file to Eclipse plugins directory and enjoy.

Reference:


1 comment:

Praveen Dande said...

I have created the jar file, but i am getting error "problem opening wizard"
Any Suggestions

Popular Posts