hadoop 1.0.4源代码在cygwin编译错误解决
环境:cygwin+hadoop1.0.4+ant1.9+jdk1.6+win7
其它过程我不再说明,google下都有了,只是在使用ant eclipse过程中,出现如下错误:
我在cygwin里使用ant eclipse构建hadoop1.0.4的时候出现如下错误,大家帮忙看看。create-native-configure:
BUILD FAILED
D:\hadoop\hadoop1.0\build.xml:618: Execute failed: java.io.IOException: Cannot r un program "autoreconf" (in directory "D:\hadoop\hadoop1.0\src\native"): CreateP rocess error=2, ?????????
at java.lang.ProcessBuilder.start(ProcessBuilder.java:460)
at java.lang.Runtime.exec(Runtime.java:593)
at org.apache.tools.ant.taskdefs.launcher.Java13CommandLauncher.exec(Jav a13CommandLauncher.java:41)哈达哦
经过反复查找,终于确定,在cygwin下,hadoop1.0.4的native lib编译本身就是不支持的,链接:http://hadoop.apache.org/docs/r1.0.4/native_libraries.html
因为我们只是了调试和分析源代码,并不一定要全部编译,所在我修改build.xml如下几行:
<target name="compile-native">
<antcall target="compile-core-native">
<param name="compile.native" value="false"/>
</antcall>
</target>
<target name="create-native-configure">
<!--<exec executable="autoreconf" dir="${native.src.dir}" searchpath="yes"
failonerror="no">
<arg value="-if"/>
</exec>-->
</target>
重新执行ant eclipse,编译成功,导入到eclipse如下: