win下编译hadoop项目--踩过的坑

装了IDEA,一直没有配环境。最近非得搞环境了--

第一次在Terminal上运行

mvn package -Pdist,native,docs -DskipTests -Dtar

出现以下error:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-antrun-plugin:1.7:run (pre-dist) on project hadoop-project-dist: An Ant BuildException has occured: Execute failed: java.io.IOException: Cannot run program "sh" (in directory "D:
\gitCode\JDHadoop-2.7.1\hadoop-project-dist\target"): CreateProcess error=2, ?????????
[ERROR] around Ant part ...<exec dir="D:\gitCode\JDHadoop-2.7.1\hadoop-project-dist\target" executable="sh" failonerror="true">... @ 41:103 in D:\gitCode\JDHadoop-2.7.1\hadoop-project-dist\target\antrun\build-main.xml
[ERROR] -> [Help 1]

然后去安装cygwin64,安装过程一直点下一步就可以了,最后在IDEA的Terminal设置中,Shell path 改为cygwin64安装目录\Cygwin.bat

第二次在Terminal上运行编译命令,出现出现了 找不到 protoc 的错误,并让我用 protoc --version 测试一下。

然后去下载安装protoc,可参考此博文 windows 环境下的 protoc 安装 

安装成功后,在Terminal上运行protoc --version 有提示:

$ protoc --version
libprotoc 2.5.0

第三次在Terminal上运行编译命令,出现以下错误:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-antrun-plugin:1.7:run (make) on project hadoop-common: An Ant BuildException has occured: Execute failed: java.io.IOException
: Cannot run program "cmake" (in directory "D:\gitCode\JDHadoop-2.7.1\hadoop-common-project\hadoop-common\target\native"): CreateProcess error=2, ?????????
[ERROR] around Ant part ...<exec dir="D:\gitCode\JDHadoop-2.7.1\hadoop-common-project\hadoop-common\target/native" executable="cmake" failonerror="true">... @ 4:129 in D:\gitCode\JDHadoop
-2.7.1\hadoop-common-project\hadoop-common\target\antrun\build-main.xml
[ERROR] -> [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

下载cmake-3.12.1-win64-x64.zip,解压并将bin目录加入到path中,运行camke --version:

$ cmake --version
cmake version 3.12.1

CMake suite maintained and supported by Kitware (kitware.com/cmake).

第四次在terminal上运行编译命令,出现以下错误:

[ERROR] Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.3.1:exec (compile-ms-winutils) on project hadoop-common: Command execution failed. Cannot run program "msbuild" (in directory "D:\gitCode\JDHadoop-2.7.1\hadoop-common-proj
ect\hadoop-common"): CreateProcess error=2, ????????? -> [Help 1]

----------------------  好吧---- 安装VSCode去............

vscode安装完就能编译了-------

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值