1. Install ant
# Sudo apt-get install ant
Ii. Modify the compilation configuration file
1. Find src/contrib/eclipse-plugin/build. xml in the hadoop installation directory and modify the following lines:
<path id="hadoop-core-jar"> <fileset dir="${hadoop.root}/"> <include name="hadoop*.jar"/> </fileset> </path> <!-- Override classpath to include Eclipse SDK jars --> <path id="classpath"> <pathelement location="${build.classes}"/> <pathelement location="${hadoop.root}/build/classes"/> <path refid="eclipse-sdk-jars"/> <path refid="hadoop-core-jar"/> </path>
......
<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-lang-2.4.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/jackson-mapper-asl-1.8.8.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/commons-httpclient-3.0.1.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>
2. Locate the build-contrib.xml under/src/contrib/and add the following content:
<property name="version" value="1.2.1"/><property name="ivy.version" value="2.1.0"/><property name="eclipse.home" location="..."/>
Note: Replace the eclipse path with the eclipse storage path on your host.
3. Find the META-INF/MANIFEST. MF file under the src/contrib/eclipse-plugin directory to change the following:
Change Bundle-ClassPath: classes/, lib/hadoop-core.jar
Bundle-ClassPath: classes/,lib/hadoop-core.jar,lib/jackson-core-asl-1.8.8.jar ,lib/jackson-mapper-asl-1.8.8.jar, lib/commons-configuration-1.6.jar,lib/commons-lang-2.4.jar, lib/commons-httpclient-3.0.1.jar,lib/commons-cli-1.2.jar
4. Return src/contrib/eclipse-plugin Compilation
Ant
5. Find the compiled plug-in hadoop-eclipse-plugin-1.2.1.jar under {hadoophome}/build/contrib/eclipse-plugin and copy it to the plugin directory under eclipse {hadoophome} For hadoop installation directory)
Note: 1. installation in a network connection Environment
2. The compiled plug-in has nothing to do with the eclipse version. It only has something to do with the hadoop version and the eclipse installation directory.
This article is from the "windhome" blog, please be sure to keep this source http://6728496.blog.51cto.com/6718496/1303425