编译Hadoop Eclipse Plugin

编译Hadoop Eclipse Plugin

环境

  • Eclipse 3.7.2
  • Ant 1.9.0
  • JDK 1.7.0_17
  • Hadoop 1.1.2

配置

修改${HADOOP_HOME}\src\contrib\eclipse-plugin\build.xml,在

<target name="jar" depends="compile" unless="skip.contrib">

增加以下内容

<copy file="${hadoop.root}/lib/commons-lang-2.4.jar" tofile="${build.dir}/lib/commons-lang-2.4.jar" verbose="true"/>
<copy file="${hadoop.root}/lib/commons-httpclient-3.0.1.jar" tofile="${build.dir}/lib/commons-httpclient-3.0.1.jar" verbose="true"/>
<copy file="${hadoop.root}/lib/commons-lang-2.4.jar" tofile="${build.dir}/lib/commons-lang-2.4.jar" verbose="true"/>
<copy file="${hadoop.root}/lib/jackson-core-asl-1.8.8.jar" tofile="${build.dir}/lib/jackson-core-asl-1.8.8.jar" verbose="true"/>
<copy file="${hadoop.root}/lib/jackson-mapper-asl-1.8.8.jar" tofile="${build.dir}/lib/jackson-mapper-asl-1.8.8.jar" verbose="true"/>

修改${HADOOP_HOME}\src\contrib\eclipse-plugin\META-INF\MANIFEST.MF,增加

 lib/commons-lang-2.4.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,
 lib/commons-cli-1.2.jar

修改${HADOOP_HOME}\src\contrib\eclipse-plugin\build.properties,增加

eclipse.home=${ECLIPSE_HOME}
version=1.1.2

编译

在${HADOOP_HOME}\src\contrib\eclipse-plugin目录执行

ant jar -lib ../../../

完成后在${HADOOP_HOME}\build\contrib\eclipse-plugin目录下会生成插件。

问题

An internal error occurred during: “Connecting to DFS master.hadoop”.
java.lang.NoClassDefFoundError: org/apache/commons/lang/StringUtils

将commons-lang-2.4.jar中的class直接压缩至hadoop-eclipse-plugin-1.1.2.jar中

你可能感兴趣的:(eclipse,hadoop)