hadoop编译报错

来源:互联网 发布:mysql 架构 编辑:程序博客网 时间:2024/06/05 00:34
错误1:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.5.1:testCompile (default-testCompile) on project hadoop-auth: Compilation failure: Compilation failure:

[ERROR] /home/hduser/hadoop-2.2.0-src/hadoop-common-project/hadoop-auth/src/test/java/org/apache/hadoop/security/authentication/client/AuthenticatorTestCase.java:[88,11] error: cannot access AbstractLifeCycle

[ERROR] class file for org.mortbay.component.AbstractLifeCycle not found

[ERROR] /home/hduser/hadoop-2.2.0-src/hadoop-common-project/hadoop-auth/src/test/java/org/apache/hadoop/security/authentication/client/AuthenticatorTestCase.java:[96,29] error: cannot access LifeCycle

[ERROR] class file for org.mortbay.component.LifeCycle not found

[ERROR] /home/hduser/hadoop-2.2.0-src/hadoop-common-project/hadoop-auth/src/test/java/org/apache/hadoop/security/authentication/client/AuthenticatorTestCase.java:[98,10] error: cannot find symbol

[ERROR] symbol:   method start()

[ERROR] location: variable server of type Server

[ERROR] /home/hduser/hadoop-2.2.0-src/hadoop-common-project/hadoop-auth/src/test/java/org/apache/hadoop/security/authentication/client/AuthenticatorTestCase.java:[104,12] error: cannot find symbol

[ERROR] -> [Help 1]


需要修改源码下边的hadoop-common-project/hadoop-auth/pom.xml  

Index: hadoop-common-project/hadoop-auth/pom.xml ===================================================================

--- hadoop-common-project/hadoop-auth/pom.xml (revision 1543124)

+++ hadoop-common-project/hadoop-auth/pom.xml (working copy)

@@ -54,6 +54,11 @@      

</dependency>      

<dependency>        

<groupId>org.mortbay.jetty</groupId>

+<artifactId>jetty-util</artifactId>

+<scope>test</scope>

+</dependency>

+<dependency>

+<groupId>org.mortbay.jetty</groupId>        

<artifactId>jetty</artifactId>        

<scope>test</scope>      

</dependency>  

添加加号部分代码。


错误2:

[ERROR] Failed to execute goal org.apache.hadoop:hadoop-maven-plugins:2.2.0:protoc (compile-protoc) on project hadoop-common: org.apache.maven.plugin.MojoExecutionException: 'protoc --version' did not return a version -> [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]  

[ERROR]  

[ERROR] After correcting the problems, you can resume the build with the command  

[ERROR]   mvn <goals> -rf :hadoop-common

hadoop2.2.0编译需要protoc2.5.0的支持,所以还要下载protoc,下载地址:https://code.google.com/p/protobuf/downloads/list

protoc依赖包:gcc,gcc-c++,make


tar -xvf protobuf-2.5.0.tar.bz2  

cd protobuf-2.5.0  

./configure --prefix=/usr/local/protoc

make && make install

然后配置环境变量:

export PATH=/usr/local/protoc/bin:$PATH

立即生效:

source /etc/profile

清除安装:

mvn clean install –DskipTests

重新编译:

mvn package -Pdist,native -DskipTests -Dtar
0 0
原创粉丝点击