hadoop最新的0.20.1包里面已经没带eclipse的plugin了
之前用0.20.0的pluggin偶尔会出问题
所以想自编译之
从http://wiki.apache.org/hadoop/EclipsePlugIn
查阅
To build the Eclipse plug-in, you need the Hadoop source files and a working Eclipse environment (version 3.3+). When compiling Hadoop, the Eclipse plug-in will be built if it founds the Eclipse environment path in the ant property "eclipse.home". The build framework looks for this property in ${hadoop-src-root}/src/contrib/eclipse-plugin/build.properties and in $HOME/eclipse-plugin.build.properties.
A typical $HOME/eclipse-plugin.build.properties file would contain the following entry: eclipse.home=/path/to/eclipse
Then the plug-in should be built when compiling Hadoop: ant clean package (from the ${hadoop-src-root} directory), which will produce {hadoop-src-root}/build/contrib/eclipse-plugin/hadoop-${version}-eclipse-plugin.jar
To install the generated plug-in in your Eclipse environment, remove first all previous versions of the plug-in from your Eclipse environment and copy the hadoop-${version}-eclipse-plugin.jar file generated as described above in your ${eclipse.home}/plugins/ directory. When you restart Eclipse, the Map/Reduce perspective should be available.
得知 只需要在 eclipse-plugin.build.properties 添加eclipse的路径 即可,没找到这个eclipse-plugin.build.properties 只找到了build.properties 添加了eclipse的安装路径
然后在hadoop的根目录 ant clean package 生成 (需要loading一些classpath) 难道不能单独ant?? 在eclipse-plus下也有build.xml 用ant compile之 会出现classpath错误生成60多个错误…
所以目前比较奇怪..
update:
换了个思路,不跟着那个网站的走 不用那个ant clean package的命令
再到src/contrib/eclipse-plugin/下
这个时候会提示
BUILD FAILED
/home/hadoop/hadoop-0.20.1/src/contrib/eclipse-plugin/build.xml:69: Warning: Could not find file /home/hadoop/hadoop-0.20.1/build/hadoop-${version}-core.jar to copy.
再去src/contrib/ 编辑build-contrib.xml 添加
<property name="version" value="0.20.1"/>
然后保存后
修改之前我习惯性的把hadoop-${version}目录改为hadoop再改回原来的,即/home/hadoop/hadoop/ 改为/home/hadoop/hadoop-0.20.1/
复制hadoop根目录下的hadoop-0.20.1-core.jar 到build/下
然后再去src/contrib/eclipse-plugin/下 ant jar 即可/home/hadoop/hadoop-0.20.1/build/contrib/eclipse-plugin/hadoop-0.20.1-eclipse-plugin.jar 生成
下载hadoop-0.20.1-eclipse-plugin.jar
标签:ant, build.xml, eclipse-plugin, Google, Google Code, hadoop, hadoop-0.20.0, hadoop-0.20.1


nice job!!
回复本留言
Jeffrey —— 2009-12-16 @12:05
我用的是eclipse3.5,hadoop版本是hadoop-0.20.1,但是很奇怪的eclipse点Run on Hadoop的时候一点反应都没有。在shell下hadoop可以正常运行。希望能解答一下这个问题。个人觉得是hadoop插件的问题,因为点插件选择新建Mapper的时候,自动继承的类已经在hadoop-0.20.1这个版本中废弃掉了。
回复本留言
jimey Reply:
一月 29th, 2010 at 01:06
在eclipse本来就不管用的功能。。没办法了。好像旧版eclipse管用
回复本留言
奇怪的问题 —— 2010-01-23 @00:38