编译hadoop-3.1.2-src错误整理
mvn package -Pdist,native -DskipTests -Dtar
1.类文件具有错误的版本 56.0, 应为 52.0
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project hadoop-auth: Compilation failure
[ERROR] /Users/ruigong/sw/hadoop-3.1.2-src/hadoop-common-project/hadoop-auth/src/main/java/org/apache/hadoop/security/authentication/util/SignerSecretProvider.java:[18,40] 无法访问org.apache.hadoop.classification.InterfaceAudience
[ERROR] 错误的类文件: /Users/ruigong/sw/hadoop-3.1.2-src/hadoop-common-project/hadoop-annotations/target/hadoop-annotations-3.1.2.jar(org/apache/hadoop/classification/InterfaceAudience.class)
[ERROR] 类文件具有错误的版本 56.0, 应为 52.0
[ERROR] 请删除该文件或确保该文件位于正确的类路径子目录中。
[ERROR]
[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/MojoFailureException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR] mvn <goals> -rf :hadoop-auth
报错是因为之前用java12编译,后来用java8执行。
1、删掉hadoop-3.1.2-src文件夹后,再重新解压编译,仍然报错;
2、接着发现报错的路径是 /Users/ruigong/./hadoop-3.1.2-src/hadoop-common-project/hadoop-annotations/target/hadoop-annotations-3.1.2.jar
3、在回收站彻底删除hadoop-3.1.2-src后,正常。
2.protobuff版本不兼容
[ERROR] Failed to execute goal org.apache.hadoop:hadoop-maven-plugins:3.1.2:protoc (compile-protoc) on project hadoop-common: org.apache.maven.plugin.MojoExecutionException: protoc version is 'libprotoc 3.8.0', expected version is '2.5.0' -> [Help 1]
3.cmake-compile失败
[ERROR] Failed to execute goal
org.apache.hadoop:hadoop-maven-plugins:3.1.2:cmake-compile
(cmake-compile) on project hadoop-yarn-server-nodemanager: make failed
with error code 2 -> [Help 1]