1、第一个坑
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project hadoop-annotations: Compilation failure: Compilation failure:
[ERROR] /Users/judy/Downloads/hadoop-2.7.3-src/hadoop-common-project/hadoop-annotations/src/main/java/org/apache/hadoop/classification/tools/RootDocProcessor.java:[20,23] 程序包com.sun.javadoc不存在
解决方法:更新java到1.8
更新java的方法
先将/Library/Java/JavaVirtualMachines 下的jdk 删除
再在网上找一个1.8的dmg 安装(不知道为什么 ,官网上看到的最新版是1.6)
mac 找不到Java的路径怎么办 命令在此 :/usr/libexec/java_home -V
2、第二个坑
[ERROR] Plugin org.apache.maven.plugins:maven-assembly-plugin:2.4 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-assembly-plugin:jar:2.4: Could not transfer artifact org.apache.maven.plugins:maven-assembly-plugin:pom:2.4 from/to central (https://repo.maven.apache.org/maven2): transfer failed for https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-assembly-plugin/2.4/maven-assembly-plugin-2.4.pom: Received fatal alert: protocol_version -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
ERROR] Failed to execute goal org.apache.hadoop:hadoop-maven-plugins:2.7.3:protoc (compile-protoc) on project hadoop-common: org.apache.maven.plugin.MojoExecutionException: protoc version is 'libprotoc 3.17.3', expected version is '2.5.0'
hadoop使用 protocol 进行通信
protocol 的版本不对,只能是 2.5.0
方法:安装 2.5.0
3、第三个坑
ERROR] Failed to execute goal org.apache.maven.plugins:maven-antrun-plugin:1.7:run (make) on project hadoop-pipes: An Ant BuildException has occured: exec returned: 1
[ERROR] around Ant part ...<exec failonerror="true" dir="/Users/judy/Downloads/hadoop-2.7.3-src/hadoop-tools/hadoop-pipes/target/native" executable="cmake">... @ 5:132 in /Users/judy/Downloads/hadoop-2.7.3-src/hadoop-tools/hadoop-pipes/target/antrun/build-main.xml
打开/Users/judy/Downloads/hadoop-2.7.3-src/hadoop-tools/hadoop-pipes/target/antrun/build-main.xml 这个文件可以看到实际是运行了下面这个语句。我们单拿出来运行
cmake /Users/judy/Downloads/hadoop-2.7.3-src/hadoop-tools/hadoop-pipes/src/ -DJVM_ARCH_DATA_MODEL=64
CMake Error at /usr/local/Cellar/cmake/3.20.5/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
Could NOT find OpenSSL, try to set the path to OpenSSL root folder in the
system variable OPENSSL_ROOT_DIR (missing: OPENSSL_INCLUDE_DIR)
Call Stack (most recent call first):
说是没有配置 OPENSSL_ROOT_DIR OPENSSL_INCLUDE_DIR
这两个环境变量。配置一下。如果没有安装openssl的,先brew intall openssl
假如所有坑的遇到了,也解决了。最后还是运行不过的话就放弃吧。
毕竟官网也说这不是必需的。