在Windows上构建hadoop 2.2

 GRcoder 发布于 2023-02-10 13:13

我试图在Windows上安装hadoop,到目前为止它真的很麻烦.

这是我不断得到的错误

[ERROR] Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.2:exec (compile-ms-winutils) on project hadoop-common: Command execution failed. Cannot run program "msbuild" (in directory "C:\hdfs\hadoop-common-project\hadoop-common"): CreateProcess error=2, The system cannot find the file specified -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR]   mvn  -rf :hadoop-common

我有windowsbuild.exe,windows sdk7.1,cygwin64,maven3.0.5,jdk7都在我的windows 7 x64盒子环境中设置.

这是我从apache网站下载的hadoop 2.2.0 src.

在系统环境下,我已经设置好了

C:\Windows\Microsoft.NET\Framework64\v4.0.30319

这是msbuild的路径,但仍然不起作用,有谁知道如何解决这个问题?

谢谢

更新:我在hadoop-common-project\hadoop-common上更改了pom.xml

msbuild

msbuild.exe

现在,我收到了以下错误

[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]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR]   mvn  -rf :hadoop-common

小智.. 10

我找到了解决这个问题的方法.我在Windows 8.1上安装了VS 2012并遇到了这个问题.我在hadoop-common下检查了该执行id的pom.xml并运行了以下命令

F:\HDP>msbuild F:\HDP\hadoop-common-project\hadoop-common\src\main\winutils\winutils.sln /nologo/p:Configuration=Release;OutDir=bin

它给了我以下例外

C:\Program Files(x86)\MSBuild\Microsoft.Cpp\v4.0\V110\Microsoft.Cpp.Platform.targets(42,5): error MSB8020: The builds tools for Visual Studio 2010 (Platform Toolset ='v100') cannot be found.
To build using the v100 build tools, either click the Project menu or right-click the solution, and then select "Update VC++ Projects...". Install Visual Studio 2010 to build using the Visual Studio 2010 build tools.
[F:\HDP\hadoop-common-project\hadoop-common\src\main\winutils\libwinutils.vcxproj]

由于我的机器上没有Visual Studio 2010,因此问题必须在解决方案中.我在VS 2012中打开了解决方案并编译了一次.执行maven再次给了我另一个错误,但这次指向hadoop-common\src\main \native \native.sln.我也在VS 2012上打开了它,没有错误.

希望这可以帮助

谢谢罗希特

1 个回答
  • 我找到了解决这个问题的方法.我在Windows 8.1上安装了VS 2012并遇到了这个问题.我在hadoop-common下检查了该执行id的pom.xml并运行了以下命令

    F:\HDP>msbuild F:\HDP\hadoop-common-project\hadoop-common\src\main\winutils\winutils.sln /nologo/p:Configuration=Release;OutDir=bin
    

    它给了我以下例外

    C:\Program Files(x86)\MSBuild\Microsoft.Cpp\v4.0\V110\Microsoft.Cpp.Platform.targets(42,5): error MSB8020: The builds tools for Visual Studio 2010 (Platform Toolset ='v100') cannot be found.
    To build using the v100 build tools, either click the Project menu or right-click the solution, and then select "Update VC++ Projects...". Install Visual Studio 2010 to build using the Visual Studio 2010 build tools.
    [F:\HDP\hadoop-common-project\hadoop-common\src\main\winutils\libwinutils.vcxproj]
    

    由于我的机器上没有Visual Studio 2010,因此问题必须在解决方案中.我在VS 2012中打开了解决方案并编译了一次.执行maven再次给了我另一个错误,但这次指向hadoop-common\src\main \native \native.sln.我也在VS 2012上打开了它,没有错误.

    希望这可以帮助

    谢谢罗希特

    2023-02-10 13:14 回答
撰写答案
今天,你开发时遇到什么问题呢?
立即提问
热门标签
PHP1.CN | 中国最专业的PHP中文社区 | PNG素材下载 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有