a. 在hadoop解壓目錄下,找到src\contrib\eclipse-plugin\build.xml,增加如下幾行: <filesetdir="${hadoop.root}"> <includename="hadoop*.jar"/> </fileset> b. 在build.xml增加如下: <property name="version"value="1.2.1"/> c. 在build.xml,修改如下: <copy file="${hadoop.root}/hadoop-core-${version}.jar"tofile="${build.dir}/lib/hadoop-core.jar"verbose="true"/> <copyfile="${hadoop.root}/lib/commons-cli-1.2.jar" todir="${build.dir}/lib"verbose="true"/> <copyfile="${hadoop.root}/lib/commons-lang-2.4.jar" todir="${build.dir}/lib"verbose="true"/> <copyfile="${hadoop.root}/lib/commons-configuration-1.6.jar" todir="${build.dir}/lib"verbose="true"/> <copyfile="${hadoop.root}/lib/jackson-mapper-asl-1.8.8.jar" todir="${build.dir}/lib"verbose="true"/> <copyfile="${hadoop.root}/lib/jackson-core-asl-1.8.8.jar" todir="${build.dir}/lib"verbose="true"/> <copyfile="${hadoop.root}/lib/commons-httpclient-3.0.1.jar" todir="${build.dir}/lib"verbose="true"/> <copyfile="${hadoop.root}/lib/commons-cli-${commons-cli.version}.jar" todir="${build.dir}/lib"verbose="true"/> d. 找到src\contrib\build-contrib.xml,添加以下幾行: <propertyname="version" value="1.2.1"/> <property name="ivy.version"value="2.1.0"/> <propertyname="eclipse.home" location="F:/hadoop/eclipse"/> e. 找到src\contrib\eclipse-plugin\META-INF,修改如下: 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 f. 開啟命令列,進入目錄\src\contrib\eclipse-plugin,輸入ant編譯,如果一切正常就編譯通過了 g. 最後可以在{hadoop_home}\build\contrib\eclipse-plugin路徑下找到編譯好的外掛程式 |