Windows下编译Hadoop

hadoop原码下载及解压

由于一直都在用2.8.5,所以这里以此版本为例,下载地址:
http://mirror.bit.edu.cn/apache/hadoop/common/hadoop-2.8.5/
在这里插入图片描述
将下载后的原码解压至一个比较简洁的路径.如E:\hadoop\hdc
在这里插入图片描述
解压后我们手动将目录改个简短名字我这里叫hdc如下:
在这里插入图片描述
然后打开BUILDING.txt文件,上面有具体编译的流程,下面附上一部分.

Building on Windows

----------------------------------------------------------------------------------
Requirements:

* Windows 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
* Windows SDK 7.1 or Visual Studio 2010 Professional
* Windows SDK 8.1 (if building CPU rate control for the container executor)
* zlib headers (if building native code bindings for zlib)
* Internet connection for first build (to fetch all Maven and Hadoop dependencies)
* Unix command-line tools from GnuWin32: sh, mkdir, rm, cp, tar, gzip. These
  tools must be present on your PATH.
* Python ( for generation of docs using 'mvn site')

Unix command-line tools are also included with the Windows Git package which
can be downloaded from http://git-scm.com/downloads

If using Visual Studio, it must be Visual Studio 2010 Professional (not 2012).
Do not use Visual Studio Express.  It does not support compiling for 64-bit,
which is problematic if running a 64-bit system.  The Windows SDK 7.1 is free to
download here:

http://www.microsoft.com/en-us/download/details.aspx?id=8279

The Windows SDK 8.1 is available to download at:

http://msdn.microsoft.com/en-us/windows/bg162891.aspx

Cygwin is neither required nor supported.

值得注意的是,编译时Cygwin已经不再被需要,也不再被支持了.

根据文档,下载并配置需要的内容:

1.JDK

https://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
在这里插入图片描述
下载后安装到默认目录即可,或者安装到自己喜欢的位置.

接下来,设置系统环境变量

# 以管理员权限运行cmd,然后执行下面的命令
jdk默认的安装路径是,C:\Program Files\Java\jdk1.8.0_231,但是文档中要求,JAVA_HOME目录不能有空格,
所以可以使用C:\PROGRA~1来代替C:\Program Files

JAVA_HOME must be set, and the path must not contain spaces. If the full path would contain spaces, then use the Windows short path instead.

setx /M JAVA_HOME "C:\PROGRA~1\Java\jdk1.8.0_231"
setx /M Path "%Path%;%JAVA_HOME%\bin;%JAVA_HOME%\jre\bin"

在这里插入图片描述
在这里插入图片描述

2.Maven

http://maven.apache.org/

  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值