在cygwin下,我实在搞不定hadoop的安装及运行
只有在ubuntu下尝试了
1.下载jdk,ant,ivy并安装
其中ivy下载后将jar包拷贝到ant 的lib目录下
2.解压hadoop压缩包
cd hadoop-1.2.1
ant eclipse
报错
create-native-configure:
BUILD FAILED
/home/steven/download/hadoop-1.2.1/build.xml:634: Execute failed: java.io.IOException: Cannot run program "autoreconf" (in directory "/home/steven/download/hadoop-1.2.1/src/native"): java.io.IOException: error=2, No such file or directory
at java.lang.ProcessBuilder.start(ProcessBuilder.java:470)
at java.lang.Runtime.exec(Runtime.java:593)
at org.apache.tools.ant.taskdefs.launcher.Java13CommandLauncher.exec(Java13CommandLauncher.java:41)
at org.apache.tools.ant.taskdefs.Execute.launch(Execute.java:428)
at org.apache.tools.ant.taskdefs.Execute.execute(Execute.java:442)
at org.apache.tools.ant.taskdefs.ExecTask.runExecute(ExecTask.java:628)
at org.apache.tools.ant.taskdefs.ExecTask.runExec(ExecTask.java:669)
at org.apache.tools.ant.taskdefs.ExecTask.execute(ExecTask.java:495)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.Target.execute(Target.java:435)
at org.apache.tools.ant.Target.performTasks(Target.java:456)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1393)
at org.apache.tools.ant.Project.executeTarget(Project.java:1364)
at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
at org.apache.tools.ant.Project.executeTargets(Project.java:1248)
at org.apache.tools.ant.Main.runBuild(Main.java:851)
at org.apache.tools.ant.Main.startAnt(Main.java:235)
at org.apache.tools.ant.launch.Launcher.run(Launcher.java:280)
at org.apache.tools.ant.launch.Launcher.main(Launcher.java:109)
Caused by: java.io.IOException: java.io.IOException: error=2, No such file or directory
at java.lang.UNIXProcess.<init>(UNIXProcess.java:148)
at java.lang.ProcessImpl.start(ProcessImpl.java:65)
at java.lang.ProcessBuilder.start(ProcessBuilder.java:452)
... 23 more
Total time: 3 minutes 56 seconds
在网上搜了一下,先执行下面两个命令,再执行ant eclipse就成功了
sudo apt-get install automake autoconf
sudo apt-get install libtool
3.build success成功后
在eclipse中将这个文件夹导入
又提示两个错误,其中一个是找不到ant_home
解决后,整个项目被重新build一遍
又提示
com.sun.tools.javac.code.Attribute.Array
找不到
将这行注释掉,就没问题了
//import com.sun.tools.javac.code.Attribute.Array;