hadoop,
参考:http://trac.nchc.org.tw/cloud/wiki/waue/2010/0211http://gushuizerotoone.iteye.com/blog/638480
http://whxhz.iteye.com/blog/1609218
可能有时候因为eclipse版本或者操作系统版本的问题使得hadoop 提供的 eclipse plugin不太好用。可以自己生成
1.修改$HADOOP_HOME/src/contrib/build-contrib.xml
增加一行::<property name="eclipse.home" location="/opt/eclipse"/>
上句后面的/opt/eclipse 由自己的$ECLIPSE_HOME代替
2.修改 $HADOOP_HOME/src/contrib/eclipse-plugin/src/java/org/apache/hadoop/eclipse/launch/HadoopApplicationLaunchShortcut.java
注释掉原来的//import org.eclipse.jdt.internal.debug.ui.launcher.JavaApplicationLaunchShortcut;
改为import org.eclipse.jdt.debug.ui.launchConfigurations.JavaApplicationLaunchShortcut;
3.执行:
cd $HADOOP_HOME
ant compile
ln -sf $HADOOP_HOME/docs $HADOOP_HOME/build/docs
ant package
4.在执行最后一句的时候会遇到问题:build.xml:908: 'java5.home' is not defined. Forrest requires Java 5. Please pass -Djava5.home=<base 5="" distribution> to Ant on the command-line.
说没有define java5的home目录,因为我装的是java6
安装jdk1.5
再去下一个apache-forrest-0.9:http://forrest.apache.org/mirrors.cgi For UNIX operating systems: apache-forrest-0.9-sources.tar.gz
解压后,(如我放在 /opt/apache-forrest-0.9)
则重新执行命令:ant package -Djava5.home=/opt/jdk1.5_22 -Dforrest.home=/opt/apache-forrest-0.9
注意上面的java5路径和apache-forrest路径要根据你自己的安装路径而设定,按上述方法由出现forrest的问题,遂采用步骤5
5.做法是对$HADOOP_HOME目录下的build.xml文件进行修改,两句注释掉,修改成如下所示:
<target name="forrest.check" unless="forrest.home" depends="java5.check">
<!--fail message="'forrest.home' is not defined. Please pass -Dforrest.home=<base of Apache Forrest installation> to Ant on the command-line." /-->
</target>
<target name="java5.check" unless="java5.home">
<!--fail message="'java5.home' is not defined. Forrest requires Java 5. Please pass -Djava5.home=<base of Java 5 distribution> to Ant on the command-line." /-->
</target>
ok,应该会在$HADOOP_HOME/build/contrib/eclipse-plugin/hadoop-0.20.3-dev-eclipse-plugin.jar
修改名字为hadoop-0.20.2-eclipse-plugin.jar。
本站文章为和通数据库网友分享或者投稿,欢迎任何形式的转载,但请务必注明出处.
同时文章内容如有侵犯了您的权益,请联系QQ:970679559,我们会在尽快处理。