千家信息网

Ubuntu编译Hadoop源码有哪些异常

发表于:2026-11-03 作者:千家信息网编辑
千家信息网最后更新 2026年11月03日,这篇文章主要为大家展示了"Ubuntu编译Hadoop源码有哪些异常",内容简而易懂,条理清晰,希望能够帮助大家解决疑惑,下面让小编带领大家一起研究并学习一下"Ubuntu编译Hadoop源码有哪些异
千家信息网最后更新 2026年11月03日Ubuntu编译Hadoop源码有哪些异常

这篇文章主要为大家展示了"Ubuntu编译Hadoop源码有哪些异常",内容简而易懂,条理清晰,希望能够帮助大家解决疑惑,下面让小编带领大家一起研究并学习一下"Ubuntu编译Hadoop源码有哪些异常"这篇文章吧。

错误1:
[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 is 'libprotoc 2.4.1', expected version is '2.5.0' -> [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/MojoExecutionException[ERROR][ERROR] After correcting the problems, you can resume the build with the command[ERROR]   mvn  -rf :hadoop-common

安装protoc

wget https://protobuf.googlecode.com/files/protobuf-2.5.0.tar.gz

(此处下载https://code.google.com/p/protobuf/downloads/list)

解压, 进入根目录执行 sudo ./configure --prefix=/usr

若安装报错:

cpp: error trying to exec 'cc1plus': execvp: No such file or directory

则安装g++

sudo apt-get install g++

sudo make

sudo make check

sudo make install

protoc --version

遇到protoc: error while loading shared libraries: libprotoc.so.8: cannot open shared object file: No such file or directory时,如ubuntu系统,默认安装在/usr/local/lib下,需要指定/usr。sudo ./configure --prefix=/usr 必须加上--proix参数,重新编译和安装。

错误2:
    [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: Execute failed: java.io.IOException: Cannot run program "cmake" (in    directory "/home/wyf/hadoop-2.0.2-alpha-src/hadoop-common-project/hadoop-    common/target/native"): java.io.IOException: error=2, No such file or directory    -> [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/MojoExecutionException

安装Cmake

sudo apt-get install cmake

错误3:
ERROR] Failed to execute goal org.codehaus.mojo.jspc:jspc-maven-plugin:2.0-alpha-3:compile (hdfs) on project hadoop-hdfs: Execution hdfs of goalorg.codehaus.mojo.jspc:jspc-maven-plugin:2.0-alpha-3:compile failed: Pluginorg.codehaus.mojo.jspc:jspc-maven-plugin:2.0-alpha-3 or one of its dependenciescould not be resolved: Could not transfer artifact ant:ant:jar:1.6.5 from/tocentral (http://repo.maven.apache.org/maven2): GET request of:ant/ant/1.6.5/ant-1.6.5.jar from central failed: Read timed out -> [Help 1][ERROR][ERROR] To see the full stack trace of the errors, re-run Maven with the -eswitch.[ERROR] Re-run Maven using the -X switch to enable full debug logging.[ERROR][ERROR] For more information about the errors and possible solutions, pleaseread the following articles:[ERROR] [Help 1]http://cwiki.apache.org/confluence/display/MAVEN/PluginResolutionException[ERROR][ERROR] After correcting the problems, you can resume the build with the command[ERROR]   mvn  -rf :hadoop-hdfs

安装ant

1.首先下载ant

百度网盘: apache-ant-1.9.4-bin.tar.gz

http://pan.baidu.com/s/1c0vjhBy

或则下面链接:

apache-ant-1.9.4-bin.tar.gz

2.解压

tar zxvf apache-ant-1.9.4-bin.tar.gz

3.配置环境变量

vim ~/.bashrc

export ANT_HOME=/home/xxl/apache-ant-1.9.4

export PATH=$ANT_HOME:$PATH

source ~/.bashrc

错误4:
    [ERROR] Failed to execute goal org.apache.hadoop:hadoop-maven-plugins:2.4.0:prot    oc (compile-protoc) on project hadoop-common: org.apache.maven.plugin.MojoExecut    ionException: '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 swit    ch.    [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 rea    d the following articles:    [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionE    xception    [ERROR]    [ERROR] After correcting the problems, you can resume the build with the command    [ERROR]   mvn  -rf :hadoop-common

protobuf版本过低

安装2.5版本的即可

错误5:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-antrun-plugin:1.6:run (compile) on project hadoop-snappy: An Ant BuildException has occured: The following error occurred while executing this line:[ERROR] /home/ngc/Char/snap/hadoop-snappy/hadoop-snappy-read-only/maven/build-compilenative.xml:75: exec returned: 2

这个原因比较恶心,是因为Hadoop snappy对gcc版本还有要求,因为我是2012年12月份的ubuntu12.04,所以gcc已经是4.6了,但是在google code那看到有人说他从gcc4.6回退成gcc4.4就ok了,我也是了一下,果然这个错误没有了。

gcc --version #查看gcc版本

gcc (Ubuntu/Linaro 4.4.7-1ubuntu2) 4.6.3

Copyright © 2010 Free Software Foundation, Inc.

本程序是自由软件;请参看源代码的版权声明。本软件没有任何担保;

包括没有适销性和某一专用目的下的适用性担保。

如何回退呢?

1. apt-get install gcc-4.4

2. rm /usr/bin/gcc

3. ln -s /usr/bin/gcc-4.4 /usr/bin/gcc

之后,再gcc --version,你就会发现,gcc已经变成4.4.7了。

错误6:
.[exec] /bin/bash ./libtool --tag=CC   --mode=link gcc -g -Wall -fPIC -O2 -m64 -g -O2 -version-info 0:1:0 -L/usr/local//lib -o libhadoopsnappy.la -rpath /usr/local/lib src/org/apache/hadoop/io/compress/snappy/SnappyCompressor.lo src/org/apache/hadoop/io/compress/snappy/SnappyDecompressor.lo  -ljvm -ldl     [exec] /usr/bin/ld: cannot find -ljvm     [exec] collect2: ld returned 1 exit status     [exec] make: *** [libhadoopsnappy.la] 错误 1     [exec] libtool: link: gcc -shared  -fPIC -DPIC  src/org/apache/hadoop/io/compress/snappy/.libs/SnappyCompressor.o src/org/apache/hadoop/io/compress/snappy/.libs/SnappyDecompressor.o   -L/usr/local//lib -ljvm -ldl  -O2 -m64 -O2   -Wl,-soname -Wl,libhadoopsnappy.so.0 -o .libs/libhadoopsnappy.so.0.0.1

网上有很多 解决/usr/bin/ld: cannot find -lxxx 这样的博客,但是这里,我告诉你,他们的都不适用。因为这儿既不是缺什么,也不是版本不对,是因为没有把安装jvm的libjvm.so symbolic link到usr/local/lib。如果你的系统时amd64,可到/root/bin/jdk1.6.0_37/jre/lib/amd64/server/察看libjvm.so link到的地方,这里修改如下:

ln -s /root/bin/jdk1.6.0_37/jre/lib/amd64/server/libjvm.so /usr/local/lib/

问题即可解决。

错误7:
[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][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.安装zlib-develubuntu安装是sudo apt-get install zlib1g-dev
错误8:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-antrun-plugin:1.7:run (make) on project hadoop-pipes: An Ant BuildException has occured: exec returned: 1[ERROR] around Ant part ...... @ 5:120 in /home/xxl/hadoop-2.5.2-src/hadoop-tools/hadoop-pipes/target/antrun/build-main.xml[ERROR] -> [Help 1]

安装:sudo apt-get install libssl-dev

错误9:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-antrun-plugin:1.7:run (tar) on project hadoop-dist: An Ant BuildException has occured: exec returned: 1[ERROR] around Ant part ...... @ 21:96 in /home/xxl/hadoop-2.5.2-src/hadoop-dist/target/antrun/build-main.xml

安装:sudo apt-get install build-essential

sudo apt-get install libglib2.0-dev

以上是"Ubuntu编译Hadoop源码有哪些异常"这篇文章的所有内容,感谢各位的阅读!相信大家都有了一定的了解,希望分享的内容对大家有所帮助,如果还想学习更多知识,欢迎关注行业资讯频道!

错误 版本 编译 源码 内容 篇文章 系统 软件 学习 帮助 担保 不对 恶心 自由 博客 原因 参数 变量 地方 易懂 数据库的安全要保护哪些东西 数据库安全各自的含义是什么 生产安全数据库录入 数据库的安全性及管理 数据库安全策略包含哪些 海淀数据库安全审计系统 建立农村房屋安全信息数据库 易用的数据库客户端支持安全管理 连接数据库失败ssl安全错误 数据库的锁怎样保障安全 上海挚品互联网科技 紫鲸互联网科技 互联网科技ppt模板 伴你行互联网科技有限公司 长亮科技 互联网金融 联恩商钥互联网科技有限公司 山东吉时兔互联网科技有限公司 科技与互联网的利与弊 港股科技和互联网 互联网与医疗科技 苏州铭阳互联网科技有限公司 搜狐科技互联网 徐州市互联网科技有限公司 广州富喜互联网络科技 富国互联网金融科技混合基金 半导体行业属于互联网高科技类吗 广州智享互联网科技 亚光科技低轨卫星互联网 上海互联网科技园景观 上海旺乐尼互联网科技有限公司 广州万易互联网科技有限公司 厦门中拓互联网络科技有限公司 科技制造互联网公司 卓越科技(互联网 ) 互联网金融监管科技 联恩商钥互联网科技有限公司 深圳互联网科技怎么样 浙南科技城互联网大厦建设工程 华中科技大学互联网的牛人 萌小萌互联网科技河南有限公司
0