bingtuag 发表于 2018-10-31 09:10:20

hadoop编译报错

  错误1:
   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:
   /home/hduser/hadoop-2.2.0-src/hadoop-common-project/hadoop-auth/src/test/java/org/apache/hadoop/security/authentication/client/AuthenticatorTestCase.java: error: cannot access AbstractLifeCycle

  >   /home/hduser/hadoop-2.2.0-src/hadoop-common-project/hadoop-auth/src/test/java/org/apache/hadoop/security/authentication/client/AuthenticatorTestCase.java: error: cannot access LifeCycle

  >   /home/hduser/hadoop-2.2.0-src/hadoop-common-project/hadoop-auth/src/test/java/org/apache/hadoop/security/authentication/client/AuthenticatorTestCase.java: error: cannot find symbol
   symbol:   method start()
   location: variable server of type Server
   /home/hduser/hadoop-2.2.0-src/hadoop-common-project/hadoop-auth/src/test/java/org/apache/hadoop/security/authentication/client/AuthenticatorTestCase.java: error: cannot find symbol
   ->
  需要修改源码下边的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 @@
  
  
  org.mortbay.jetty
  +jetty-util
  +test
  +
  +
  +org.mortbay.jetty
  jetty
  test
  
  添加加号部分代码。
  错误2:
   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 ->
  
   To see the full stack trace of the errors, re-run Maven with the -e switch.
   Re-run Maven using the -X switch to enable full debug logging.
  
   For more information about the errors and possible solutions, please read the following articles:
   http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
  
   After correcting the problems, you can resume the build with the command
     mvn-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

页: [1]
查看完整版本: hadoop编译报错