https://svn.apache.org/repos/asf/hadoop/common/branches/branch-trunk-win/BUILDING.txtjava
http://www.srccodes.com/p/article/38/build-install-configure-run-apache-hadoop-2.2.0-microsoft-windows-osapache
$ mvn package -Pdist -DskipTests -Dtar windows
緣由是在導入eclipse是手動生成的文件和hadoop的maven自動配置出現衝突。eclipse
將手動添加的部分刪除。maven
可在源碼同級創建臨時文件夾執行以下batide
mv ../hadoop-2.4.0-src/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/ipc/protobuf/TestProtos.java ./ mv ../hadoop-2.4.0-src/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/io/serializer/avro/AvroRecord.java ./ mv ../hadoop-2.4.0-src/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/ipc/protobuf/TestRpcServiceProtos.java ./
mv TestProtos.java ../hadoop-2.4.0-src/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/ipc/protobuf/ mv AvroRecord.java ../hadoop-2.4.0-src/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/io/serializer/avro/ mv TestRpcServiceProtos.java ../hadoop-2.4.0-src/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/ipc/protobuf/
多是java版本問題。java8不行,換成了java6svn
源碼最好直接放到分區下的一級目錄。目錄名也能夠重命名的短一點工具
這個能夠參考http://www.tuicool.com/articles/M3MRvea。oop
打開「開始」--「全部程序」--「Microsoft Windows SDK v7.1」--「Windows SDK 7.1 Command Prompt」,進入VC++的命令行工具(必定要今後處進入方可順利編譯Hadoop源代碼,記着是以管理員身份運行)ui
可是仍是失敗,這些貌似是與操做系統相關的c代碼,目前不須要變動,暫時不用編譯。
能夠修改:\hadoop-common-project\hadoop-common\pom.xml
在project>profiles>profile>id=native-win的profile中將<properties>和<build>兩個結點刪除。