编译hadoop2.8.0

参考文档:https://diary-of-programmer.blogspot.com/2014/11/hadoop-tips-hadoop-build-error-related-findbugs-protobuf-avro.html


terminal 编译hadoop:

yum -y install zlib-devel autoconf automake  cmake libtool openssl-deve


按照BUILDING.txt的要求

Requirements:


* Unix System
* JDK 1.7+
* Maven 3.0 or later
* Findbugs 1.3.9 (if running findbugs)
* ProtocolBuffer 2.5.0
* CMake 2.6 or newer (if compiling native code), must be 3.0 or newer on Mac
* Zlib devel (if compiling native code)
* openssl devel (if compiling native hadoop-pipes and to get the best HDFS encryption performance)
* Linux FUSE (Filesystem in Userspace) version 2.6 or above (if compiling fuse_dfs)
* Internet connection for first build (to fetch all Maven and Hadoop dependencies)


只少需要java ,maven ,protocolbuffer  cmake  ,zlib ,openssl 

安装完后执行:

mvn package -Pdist,native,src -DskipTests -Dtar

需要下载很多东西,请保持足够的空间。


Eclipse:


Importing projects to eclipse

When you import the project to eclipse, install hadoop-maven-plugins at first.


  $ cd hadoop-maven-plugins
  $ mvn install


Then, generate eclipse project files.

进入到root ,src 目录下
  $ mvn eclipse:eclipse -DskipTests


At last, import to eclipse by specifying the root directory of the project via
[File] > [Import] > [Existing Projects into Workspace].

发现有很多错误

1、访问限制的错误,到windows->preferences->java->compiler->Errors/warning 下Deprecated  and restricated api ,Forbidden reference 改为warning.

2、source file missing , 到build path  remove 到引用

3、class can't find . 在 root src 目录下 搜索 对应java 文件。例如AvroRecord.java TestProtos.java  拷贝到对应目录。2.8.0 在grepcode.com 代码目前还没有,之前的版本也可以在grepcode.com 下载对应文件




评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值