在Windows 7 64位和Java 8上构建hadoop 2.6.0时出现问题

在Windows 7 64位和Java 8上构建hadoop 2.6.0时出现问题,java,windows,maven,hadoop,Java,Windows,Maven,Hadoop,由于hadoop 2.6.0包不包含Windows二进制文件,因此我尝试使用Windows 7 64位、Java 8、Windows SDK 7.1、Apache Maven 3.3.1和Visual Studio 2013自行构建它们。我遵循这些指示: 在Windows SDK 7.1命令提示符下执行此命令后: mvn package -Pdist,native-win -DskipTests -Dtar 我不断得到以下错误: LINK : fatal error LNK1123: fai

由于hadoop 2.6.0包不包含Windows二进制文件,因此我尝试使用Windows 7 64位、Java 8、Windows SDK 7.1、Apache Maven 3.3.1和Visual Studio 2013自行构建它们。我遵循这些指示:

在Windows SDK 7.1命令提示符下执行此命令后:

mvn package -Pdist,native-win -DskipTests -Dtar
我不断得到以下错误:

LINK : fatal error LNK1123: failure during conversion to COFF: file invalid orcorrupt [E:\build\hadoop-common-project\hadoop-common\src\main\winutils\winutils.vcxproj]

....

[ERROR] Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.2:exec (compile-ms-winutils) on project hadoop-common: Command execution failed. Process exited with an error: 1(Exit value: 1) -> [Help 1]
我尝试过其他线程中建议的不同解决方案,但没有成功:

有人能帮我吗

如果您能提供考虑到我的电脑配置的Windows二进制文件(Hadoop 2.6.0、Windows 7 64位和Java 8),这也会很有帮助


谢谢

这是已知的Visual Studio 2012问题

解释如何修复它

总结如下:

  • 通过转到,禁用增量链接

    Project Properties 
       -> Configuration Properties 
           -> Linker (General) 
              -> Enable Incremental Linking -> "No (/INCREMENTAL:NO)"
    
  • 或者安装VS2010 SP1


打开位于解压缩的hadoop-2.6.0-src.tar.gz或您的版本中的文件BUILDING.txt
它说明了如何为Windows构建-请检查所有这些:

My BUILDING.txt显示:


我将本教程用于我的Windows 8 x64、Windows SDK 7.1、jdk1.6.0_45,并获得了成功。感谢链接,这些是我构建二进制文件所遵循的步骤。我最终通过完全删除VisualStudio解决了这个错误。
Building on Windows
Requirements:

* Windows System
* JDK 1.6+
* Maven 3.0 or later
* Findbugs 1.3.9 (if running findbugs)
* ProtocolBuffer 2.5.0
* CMake 2.6 or newer
* Windows SDK or Visual Studio 2010 Professional
* Unix command-line tools from GnuWin32 or Cygwin: sh, mkdir, rm, cp, tar, gzip
* zlib headers (if building native code bindings for zlib)
* 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