要学习开源项目,查看源码是必须的。下面记录一下我在myeclipse中加载hadoop 源码的过程。
1、到http://archive.apache.org/dist/hadoop/core/hadoop-1.1.2/中下载 hadoop-1.1.2.tar.gz hadoop 包。
2、安装myeclipse
3、解压 hadoop-1.1.2.tar.gz 使用里面的src
4、绑定顺序 core examples hdfs mapred test tools
5、myeclipse 下新建一个web project
编码选择UTF-8
Java Compiler 选择 1.6
6、在项目中新建 sorce_folder : core examples hdfs mapred test tools
7、分别把源码中对应文件件中的org文件内容copy到对应的sorce_folder中。并把对应的core-default.xml mapred-default.xml hdfs-default.xml放到src文件夹中。
8、把hadoop-1.1.2 根目录下的jar包,lib目录下的jar包,由于使用了Test,还要把scr/test/lib下的jar包 全部导入。
导入后发现还有一个文件错误:RccTask 。这是因为缺少ant包,去http://archive.apache.org/dist上找到ant
把ant.jar加入后,就没有错误了。
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/30066956/viewspace-1590939/
,如需转载,请注明出处,否则将追究法律责任。