前言

由于hadoop2.2.0官方未提供64位的可执行版本,所以只能通过下载源代码自己进行编译,本文以这几天笔者实际编译过程中遇到的错误(不保证一定会遇到)作为记录参考。

编译运行环境

  • ubuntu 64位

遇到的错误

[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] /Users/JuneMAC/hadoop/release-2.2.0/hadoop-common-project/hadoop-auth/src/test/java/org/apache/hadoop/security/authentication/client/AuthenticatorTestCase.java:[88,11] 错误: 无法访问AbstractLifeCycle

解决方案:

vi hadoop-common-project/hadoop-auth/pom.xml

 <dependency>
      <groupId>org.mortbay.jetty</groupId>
      <artifactId>jetty</artifactId>
      <scope>test</scope>
 </dependency>

前面加上

 <dependency>
      <groupId>org.mortbay.jetty</groupId>
      <artifactId>jetty-util</artifactId>
      <scope>test</scope>
 </dependency>

[exec] CMake Error at /usr/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:57 (MESSAGE): [exec] Could NOT find ZLIB (missing: ZLIB_INCLUDE_DIR) [exec] Call Stack (most recent call first): [exec] /usr/share/cmake/Modules/FindZLIB.cmake:22 (FIND_PACKAGE_HANDLE_STANDARD_ARGS) [exec] CMakeLists.txt:89 (find_package) [ERROR] Failed to execute goal org.apache.maven.plugins:maven-antrun-plugin:1.6:run (make) on project hadoop-common: An Ant BuildException has occured: exec returned: 1 -> [Help 1]

解决方案: 安装 http://www.zlib.net/

错误 Could NOT find OpenSSL, try to set the path to OpenSSL root folder in the
[exec] system variable OPENSSL_ROOT_DIR (missing: OPENSSL_LIBRARIES

解决方案: sudo apt-get install libssl-dev

小结

本文并未指出所有可能遇到的错误,这里只是总结在某次编译过程中可能遇到的错误以及解决办法。

##文档信息