环境准备
官方 building.txt
Requirements:
* Windows System
* JDK 1.7+ 只能是jdk1.7, require ( 1.7.0~1.7.10000),安装路径不含空格!
* Findbugs 1.3.9 (if running findbugs) path +=D:\SoftWare\findbugs-3.0.1\bin
* ProtocolBuffer 2.5.0 复制放进 c:\windows
* CMake 2.6 or newer 用了3.6(2.6并没有64位的) , path += C:\Program Files\CMake\bin
* Windows SDK or Visual Studio 2010 Professional 推荐使用windows sdk , win7使用(win sdk 7.1 & .net framework 4.0)
* Unix command-line tools from GnuWin32 or Cygwin: sh, mkdir, rm, cp, tar, gzip path+=D:\SoftWare\cygwin64\bin
* zlib headers (if building native code bindings for zlib) 增加ZLIB_HOME,path+=%ZLIB_HOME%\bin
* Internet connection for first build (to fetch all Maven and Hadoop dependencies)
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 is free to
download here:
http://www.microsoft.com/en-us/download/details.aspx?id=8279
编译
打开 Windows SDK 7.1 Command Prompt (开始菜单) , cd到源码目录
set Platform=x64 (when building on a 64-bit system)
set Platform=Win32 (when building on a 32-bit system)
mvn install -DskipTests
mvn package -Pdist,native-win -DskipTests -Dtar
剩下的就是漫长的等待,中间下载中断无数次..
参考
http://fatkun.com/2015/05/compile-hadoop-cdh5-4-on-windows.html
https://blog.csdn.net/oneinmore/article/details/44996811
http://flashing.iteye.com/blog/2139534