Trunk无法编译,因为在Eclipse下使用Hadoop时libprotoc已经过时了

我正在关注“在Eclipse下使用Hadoop”并尝试运行

$ mvn install -DskipTests 

过了一会儿,我收到一个错误:

[错误]无法执行目标org.apache.hadoop:hadoop-maven-plugins:3.0.0-SNAPSHOT:项目上的protoc(compile-protoc)hadoop-common:org.apache.maven.plugin.MojoExecutionException:protoc version is ‘libprotoc 2.4.1’,预期版本为’2.5.0’ – > [帮助1]

它与本页报告的内容相同。

有谁知道如何解决它? 我该怎么做才能升级libprotoc?

Protocol Buffers用作不同守护进程之间的RPC协议。 某些Linux版本没有所需的版本。 因此,必须从此处下载,构建和安装Protocol Buffers代码。 这些是下载包中README.txt的说明。

 To build and install the C++ Protocol Buffer runtime and the Protocol Buffer compiler (protoc) execute the following: $ ./configure $ make $ make check $ make install If "make check" fails, you can still install, but it is likely that some features of this library will not work correctly on your system. Proceed at your own risk. "make install" may require superuser privileges. 

执行这个bash函数,它将下载protobuffer 2.5.0并使用sudo权限进行安装。 (在ubuntu 13.04中测试过)

  configureProtoc(){ sudo apt-get install -y gcc g++ make maven cmake zlib zlib1g-dev libcurl4-openssl-dev curl -# -O https://protobuf.googlecode.com/files/protobuf-2.5.0.tar.gz gunzip protobuf-2.5.0.tar.gz tar -xvf protobuf-2.5.0.tar cd protobuf-2.5.0 ./configure --prefix=/usr make sudo make install } 

安装protoc后别忘了链接共享库:

LDCONFIG