hadoop编译过程中遇到的错误

一笑奈何 提交于 2019-12-10 19:50:40

【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>>

我用的环境(错误跟环境没关系):centos6.4,hadoop2.6.4(或者hadoop2.7.6或者hadoop2.6.5)

错误1mvn clean install -DskipTests中遇到:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.5.1:compile (default-compile) on project hadoop-minikdc: Compilation failure: Compilation failure: 
[ERROR] error: error reading /root/.m2/repository/org/apache/directoryrver/apacheds-interceptor-kerberos/2.0.0-M15/apacheds-interceptor-kerberos-2.0.0-M15.jar; error in opening zip file
[ERROR] error: error reading /root/.m2/repository/org/apache/directoryrver/apacheds-interceptors-collective/2.0.0-M15/apacheds-interceptors-collective-2.0.0-M15.jar; error in opening zip file

截图:

错误原因:下载的jar包有问题(可能不完整),所以报“error in opening zip file”

解决办法:从本机讲对应的jar包下载来,覆盖linux上maven库中有问题的jar包。

【错误2】:执行mvn package -Pdist,native -DskipTests -Dtar这一步的时候报报错
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-antrun-plugin:1.7:run (dist) on project hadoop-kms: An Ant BuildException has occured: exec returned: 2
[ERROR] around Ant part ...<exec dir="/home/hadoop/apps/hadoop2.6.4/hadoop-common-project/hadoop-kms/target" executable="sh" failonerror="true">... @ 10:120 in /home/hadoop/apps/hadoop2.6.4/hadoop-common-project/hadoop-kms/target/antrunbuild-main.xml

截图:

解决办法:

首先使用java -version查看版本号是否跟自己安装的版本号一致,如果不一致,那么执行命令ll /usr/bin/java检查指向,具体修改方法自行搜索;

如果java -version看到的版本号正常,那么进行下面的操作:

查看 hadoop-common-project/hadoop-kms/target/antrun/build-main.xml 文件中使用的apache-tomcat版本号,并下载(文件中有地址),然后放到目录 hadoop2.6.4/hadoop-common-project/hadoop-kms/downloads

找downloads目录方法:

build-main.xml配置文件中有:

​​​​​​​<echo file="/home/hadoop/apps/hadoop2.6.4/hadoop-common-project/hadoop-kms/target/tomcat-untar.sh">cd &quot;/home/hadoop/apps/hadoop2.6.4/hadoop-common-project/hadoop-kms/target/tomcat.exp&quot;gzip -cd ../../downloads/apache-tomcat-6.0.41.tar.gz | tar xf -</echo>

其中的../../downloads/apache-tomcat-6.0.41.tar.gz就是该放的目录,../../是相对于tomcat-untar.sh来说的,所以downloads目录应该是:/home/hadoop/apps/hadoop2.6.4/hadoop-common-project/hadoop-kms

 

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!