Since the development of the Hadoop program under Eclipse requires plug-in support, and there is no plugin in the Hadoop report, so we need to compile ourselves, the following steps
1. Enter the D:\hadoop-1.2.1\src\contrib directory, locate the Build-contrib.xml file, and change the hadoop.root to the Hadoop directory.
<property name= "Hadoop.root" location= "D:\hadoop-1.2.1"/>
Add the following two lines below: The Eclipse installation root directory, and the Hadoop version.
<property name= "Eclipse.home" location= "D:\eclipse"/>
<property name= "version" value= "1.2.1"/>
2. Modify the build.xml file under D:\hadoop-1.2.1\src\contrib\eclipse-plugin (the red part is new)
<target name= "Jar" depends= "compile" unless= "Skip.contrib" >
<mkdir dir= "${build.dir}/lib"/>
<copy file= "${hadoop.root}/hadoop-core-${version}.jar" tofile= "${build.dir}/lib/hadoop-core.jar" verbose= "true "/>
<copy file= "${hadoop.root}/lib/commons-cli-1.2.jar" todir= "${build.dir}/lib" verbose= "true"/>
<copy file= "${hadoop.root}/lib/commons-configuration-1.6.jar" todir= "${build.dir}/lib" verbose= "true"/>
<copy file= "${hadoop.root}/lib/commons-httpclient-3.0.1.jar" todir= "${build.dir}/lib" verbose= "true"/>
<copy file= "${hadoop.root}/lib/commons-lang-2.4.jar" todir= "${build.dir}/lib" verbose= "true"/>
<copy file= "${hadoop.root}/lib/jackson-core-asl-1.8.8.jar" todir= "${build.dir}/lib" verbose= "true"/>
<copy file= "${hadoop.root}/lib/jackson-mapper-asl-1.8.8.jar" todir= "${build.dir}/lib" verbose= "true"/>
<jar
Jarfile= "${build.dir}/hadoop-${name}-${version}.jar"
Manifest= "${root}/meta-inf/manifest. MF ">
<fileset dir= "${build.dir}" includes= "classes/lib/"/>
<fileset dir= "${root}" includes= "Resources/plugin.xml"/>
</jar>
</target>
Find <path id= "classpath" > tag, add below
3. Modify the MANIFEST.MF file. Catalog: D:\hadoop-1.2.1\src\contrib\eclipse-plugin\META-INF
Add the following information to the Bundle-classpath column:
bundle-classpath:classes/,
4. Go to Hadoop directory D:\hadoop-1.2.1\src\contrib\eclipse-plugin, compile with ant, and finally in D:\hadoop-1.21\build\contrib\ Eclipse-plugin below to find your plugin, copy the plugin to the Eclipse/plugin directory, restart.
This article is from the "Wandering" blog, please be sure to keep this source http://1161384.blog.51cto.com/1151384/1416507