2

I get this error while I compile hadoop source code with maven.

I am using windows 8.1, hadoop 2.7.2 and visual studio 2012.

I followed this link Maven MojoExecutionException but it didnt work.

For installing hadoop I use http://harishshan.blogspot.com/2014/10/install-hadoop-251-on-windows-7-64bit.html.

[ERROR] Failed to execute goal org.apache.hadoop:hadoop-maven-plugins:2.7.2: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 <goals> -rf :hadoop-common 

1 Answer 1

2

The exception is not related to Maven. The error message is actually already pointing at the main issue:

[ERROR] Failed to execute goal org.apache.hadoop:hadoop-maven-plugins:2.7.2:protoc \ (compile-protoc) on project hadoop-common: \ org.apache.maven.plugin.MojoExecutionException: \ 'protoc --version' did not return a version -> [Help 1] 

The protoc goal of the org.apache.hadoop:hadoop-maven-plugins Maven Plugin is checking whether the protoc command is available in the PATH, checking the simplest common command: the version command:

protoc --version 

Looking at the tutorial you linked you most probably missed Step 4:

Step 4: Install Protocol buffer 2.5.0

Or you probably didn't configure it properly, not making it available via the command PATH.


Update
The tutorial indeed doesn't provide much information about from where and how to install Protocol Buffer.

The version described by the tutorial is 2.5.0, available here. You can download the Windows zip here. Then simply unzip it and add its path to the Windows PATH: before checking whether the Maven build will then recognize it, first check whether the protoc --version would fine or not from any command line.


Also note: comments to the tutorial point to other errors as well, double check them in case you still encounter other errors in the overall process.

Sign up to request clarification or add additional context in comments.

14 Comments

it says that I just download and extract in c:\protocbuf and then set in the path.and I did.can you explain more clear .thank
did you try from any console to execute the same command, protoc --version and check whether that works or not?
'protoc' is not recognized as an internal or external command, operable program or batch file.what I should do?
that is, that means it is not available in the PATH and as such the hadoop maven plugin is failing. This also means you didn't configure it properly in the path, double check whether the command is in the protobuf folder or in a bin subfolder, the folder containing the command should actually be added to the PATH (may be the tutorial has a mistake then).
C:\hdfs>protoc --version libprotoc 3.0.0. thanks .but let me test it for compile. I hope it works.
|

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.