{"id":1328,"date":"2015-12-02T17:17:32","date_gmt":"2015-12-02T09:17:32","guid":{"rendered":"http:\/\/www.strongd.net\/?p=1328"},"modified":"2015-12-02T17:21:27","modified_gmt":"2015-12-02T09:21:27","slug":"protoc-version-did-not-return-a-version","status":"publish","type":"post","link":"https:\/\/www.strongd.net\/?p=1328","title":{"rendered":"protoc &#8211;version&#8217; did not return a version"},"content":{"rendered":"<p>\u6309\u7167hadoop\u5b98\u65b9\u7f51\u7ad9\u7684\u6587\u6863\uff0c\u8def\u5f84\u4e3a<a href=\"http:\/\/hadoop.apache.org\/docs\/r2.2.0\/hadoop-project-dist\/hadoop-common\/SingleCluster.html#Hadoop_MapReduce_Next_Generation_-_Setting_up_a_Single_Node_Cluster.\" target=\"_blank\">http:\/\/hadoop.apache.org\/docs\/r2.2.0\/hadoop-project-dist\/hadoop-common\/SingleCluster.html.<\/a>\u7528svn co\u00a0http:\/\/svn.apache.org\/repos\/asf\/hadoop\/common\/trunk\u4e0b\u8f7d\u8d44\u6e90\uff0c\u4f7f\u7528\u00a0mvn clean install -DskipTests \u8fdb\u884c\u7f16\u8bd1\u65f6\u5019\uff0c\u629b\u51fa\u5f02\u5e38<\/p>\n<p>INFO] &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br \/>\n[ERROR] Failed to execute goal org.apache.hadoop:hadoop-maven-plugins:3.0.0-SNAPSHOT:protoc (compile-protoc) on project hadoop-common: org.apache.maven.plugin.MojoExecutionException: &#8216;protoc &#8211;version&#8217; did not return a version -&gt; [Help 1]<br \/>\n[ERROR]<br \/>\n[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.<br \/>\n[ERROR] Re-run Maven using the -X switch to enable full debug logging.<br \/>\n[ERROR]<br \/>\n[ERROR] For more information about the errors and possible solutions, please read the following articles:<br \/>\n[ERROR] [Help 1] http:\/\/cwiki.apache.org\/confluence\/display\/MAVEN\/MojoExecutionException<br \/>\n[ERROR]<br \/>\n[ERROR] After correcting the problems, you can resume the build with the command<br \/>\n[ERROR] \u00a0 mvn &lt;goals&gt; -rf :hadoop-common<\/p>\n<p>[ERROR] Failed to execute goal org.apache.hadoop:hadoop-maven-plugins:3.0.0-SNAPSHOT:protoc (compile-protoc) on project hadoop-common: org.apache.maven.plugin.MojoExecutionException: &#8216;protoc &#8211;version&#8217; did not return a version -&gt; [Help 1]<br \/>\n[ERROR]<br \/>\n[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.<br \/>\n[ERROR] Re-run Maven using the -X switch to enable full debug logging.<br \/>\n[ERROR]<br \/>\n[ERROR] For more information about the errors and possible solutions, please read the following articles:<br \/>\n[ERROR] [Help 1] http:\/\/cwiki.apache.org\/confluence\/display\/MAVEN\/MojoExecutionException<br \/>\n[ERROR]<br \/>\n[ERROR] After correcting the problems, you can resume the build with the command<\/p>\n<p>[ERROR] \u00a0 mvn &lt;goals&gt; -rf :hadoop-common<\/p>\n<p>\u7ecf\u8fc7\u67e5\u627e\u539f\u56e0\uff0c\u9002\u7528\u4e8e\u6ca1\u6709\u6ca1\u6709\u5b89\u88c5\u00a0protoc 2.5.0\uff0c\u5728\u5b98\u7f51\u63d0\u793a\u4e3a\uff1aNOTE:\u00a0You will need protoc 2.5.0 installed.<\/p>\n<p>\u9700\u8981\u5b89\u88c5\u00a0protoc 2.5.0\uff0c\u4ed6\u662fgoogle\u7684\u4e00\u4e2a\u6570\u636e\u7f13\u51b2\u9ad8\u6548\u53ef\u6269\u5c55\u7684\u670d\u52a1\u5305\uff0c<\/p>\n<p>\u4e0b\u8f7d\u5730\u5740\u4e3a<a href=\"http:\/\/code.google.com\/p\/protobuf\/downloads\/list\" target=\"_blank\">http:\/\/code.google.com\/p\/protobuf\/downloads\/list<\/a><\/p>\n<p>\u7531\u4e8e\u4f7f\u7528\u7684linux\u7cfb\u7edf\uff0c\u6240\u4ee5\u4e0b\u7684\u00a0<a href=\"http:\/\/protobuf.googlecode.com\/files\/protobuf-2.5.0.tar.gz\" target=\"_blank\">protobuf-2.5.0.tar.gz<\/a>\u00a0\u00a0 2.3 MB<\/p>\n<p>\u7136\u540e\uff0c\u5b89\u88c5protobuf \u670d\u52a1\u5305\uff0c\u5b98\u65b9\u63d0\u4f9b\u7684\u547d\u4ee4\u5982\u4e0b\uff1a<\/p>\n<table id=\"src_table_0\">\n<tbody>\n<tr id=\"sl_svn512_11\">\n<td class=\"source\">$ .\/configure<\/td>\n<\/tr>\n<tr id=\"sl_svn512_12\">\n<td class=\"source\">$ make<\/td>\n<\/tr>\n<tr id=\"sl_svn512_13\">\n<td class=\"source\">$ make check<\/td>\n<\/tr>\n<tr id=\"sl_svn512_14\">\n<td class=\"source\">$ make install<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u5982\u679c\uff0c\u5982\u679c\u7cfb\u7edf\u9ed8\u8ba4\u5b89\u88c5\u4e86gcc,\u5c06\u4f1a\u987a\u5229\u7684\u5b8c\u6210\uff0c\u5982\u679c\u6ca1\u6709\u7684\u8bdd\uff0c\u5c06\u4f1a\u629b\u51fa\u627e\u4e0d\u5230 \u00a0\u627e\u4e0d\u5230\u5f53\u524d\u7684\u6587\u4ef6\u5939 $path\u8def\u5f84\uff0c<\/p>\n<pre>\u7531\u4e8e\u6211\u662f\u7528\u7684ubuntu,\u4f7f\u7528<\/pre>\n<pre>sudo apt-get install gcc<\/pre>\n<pre>\u5982\u679c\u4e0d\u80fd\u5b89\u88c5\u5b8c\u6210\uff0c\u4f60\u9700\u8981\u66f4\u884c<\/pre>\n<pre>sudo apt-get update \u66f4\u65b0ubuntu \u7684\u5e93<\/pre>\n<pre>\u7136\u540e\u518d\u7ee7\u7eed\u7684\u5b89\u88c5<\/pre>\n<pre>sudo apt-get install gcc<\/pre>\n<p>&nbsp;<\/p>\n<p>\u9762\u5bf9\u4e0b\u9762\u7684\u9519\u8bef\uff0c\u767e\u5ea6\u4e00\u4e0b\uff0c\u8fd9\u662f\u7f3a\u5c11\u76f8\u5e94\u7684\u5e93\u5bfc\u81f4\u7684\uff0c\u6240\u4ee5\u53ef\u80fd\u5728\u4e0d\u540c\u7cfb\u7edf\uff0c\u5b89\u88c5\u4e0d\u540c\u8f6f\u4ef6\u7684\u65f6\u5019\u90fd\u53ef\u80fd\u51fa\u73b0\u3002<\/p>\n<p>configure: error: C++ preprocessor &#8220;\/lib\/cpp&#8221; fails sanity check<\/p>\n<pre>\u4f7f\u7528\u4e0b\u8f7d\u5e93\u6587\u4ef6\uff0c sudo apt-get install build-essential<\/pre>\n<p>&nbsp;<\/p>\n<p>\u7136\u540e\uff0c\u5728\u6267\u884c.\/configure,\u987a\u5229\u7684\u5b8c\u6210<\/p>\n<p>\u5728\u540e\u67e5\u770b\u7248\u672c\uff0c$protoc &#8211;version<\/p>\n<p>\u5c06\u4f1a\u63d0\u793a\u627e\u4e0d\u5230 protoc<\/p>\n<p>\u8ba9\u4f60\u5b89\u88c5 \u00a0sudo apt-get install protobuf-compiler<\/p>\n<p>\u4e0d\u8981\u5b89\u88c5\uff0c\u5982\u679c\u5b89\u88c5\u4e86\uff0c\u5b83\u548c\u4f60\u7684<a href=\"http:\/\/protobuf.googlecode.com\/files\/protobuf-2.5.0.tar.gz\" target=\"_blank\">protobuf-2.5.0.tar.gz<\/a>\u00a0 \u6ca1\u4ec0\u4e48\u5173\u7cfb\uff0c\u8fd0\u884c<\/p>\n<p>$protoc &#8211;version<\/p>\n<p>libprotoc.2.4.1<\/p>\n<p>hadoop \u8981\u6c42\u7684\u7248\u672c\u4e3a2.5.0\uff0cmvn\u7f16\u8bd1\u5c06\u4e0d\u901a\u8fc7\u3002<\/p>\n<p>\u8fd9\u4e2a\u65f6\u5019\u4e0d\u614c\uff0c\u56e0\u4e3a<a href=\"http:\/\/protobuf.googlecode.com\/files\/protobuf-2.5.0.tar.gz\" target=\"_blank\">protobuf-2.5.0.tar.gz<\/a>\u00a0 \u6211\u4eec\u5df2\u7ecf\u7f16\u8bd1\u5b8c\u4e86\uff0c<\/p>\n<p>\u53ea\u9700\u8981\u5b8c\u6210\u914d\u7f6e\u5b8c\u6210\u5c31\u884c\u4e86<\/p>\n<p>$sudo vi \/etc\/profile<\/p>\n<p>export PROTOC_HOME=\/opt\/protobuf-2.5.0<\/p>\n<p>export PATH=$PATH:$PROTOC_HOME\/src<\/p>\n<p>\u7136\u540e\uff0c<\/p>\n<p>$protoc &#8211;version<\/p>\n<p>libprotoc.2.5.0<\/p>\n<p>\u795d\u4f60\u6210\u529f<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6309\u7167hadoop\u5b98\u65b9\u7f51\u7ad9\u7684\u6587\u6863\uff0c\u8def\u5f84\u4e3ahttp:\/\/hadoop.apache.org\/docs\/r2.2.0\/hadoop-project-dist\/hadoop-common\/SingleCluster.html.\u7528svn co\u00a0http:\/\/svn.apache.org\/repos\/asf\/hadoop\/common\/trunk\u4e0b\u8f7d\u8d44\u6e90\uff0c\u4f7f\u7528\u00a0mvn clean install -DskipTests \u8fdb\u884c\u7f16\u8bd1\u65f6\u5019\uff0c\u629b\u51fa\u5f02\u5e38 INFO] &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212; [ERROR] Failed to execute goal org.apache.hadoop:hadoop-maven-plugins:3.0.0-SNAPSHOT:protoc (compile-protoc) on project hadoop-common: org.apache.maven.plugin.MojoExecutionException: &#8216;protoc &#8211;version&#8217; did not return a version -&gt; [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 &hellip; <a href=\"https:\/\/www.strongd.net\/?p=1328\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">protoc &#8211;version&#8217; did not return a version<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1,20],"tags":[197],"class_list":["post-1328","post","type-post","status-publish","format-standard","hentry","category-java","category-20","tag-hadoop-maven"],"_links":{"self":[{"href":"https:\/\/www.strongd.net\/index.php?rest_route=\/wp\/v2\/posts\/1328","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.strongd.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.strongd.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.strongd.net\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.strongd.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1328"}],"version-history":[{"count":1,"href":"https:\/\/www.strongd.net\/index.php?rest_route=\/wp\/v2\/posts\/1328\/revisions"}],"predecessor-version":[{"id":1329,"href":"https:\/\/www.strongd.net\/index.php?rest_route=\/wp\/v2\/posts\/1328\/revisions\/1329"}],"wp:attachment":[{"href":"https:\/\/www.strongd.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1328"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.strongd.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1328"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.strongd.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1328"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}