How to build sources from under the windows?

An attempt to build hadoop from sources under windows 7 x64. According to Hadoop2OnWindows and BUILDING instructions

I cloned the extraction sources from git , checkout to origin/branch-2.5 (SHA-1: fa3bb675a728105d69614f53abe4339958550adf) Then from the Windows console I run:

  • set Platform=x64
  • clean install -Pdist,native-win -DskipTests -Dtar

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

Any ideas how to solve this problem?

+5
source share
2 answers

The first thing that protoc mojo does from add-maven plugins is to use the Java class java.lang.Process to try and execute the following command:

 protoc --version 

This is mainly done to verify that the protocol protocol compiler (protoc) version on your system matches the protobuf JAR version.

There are 4 results for this:

  • he could not find the protoc command to execute (gets the output value 127)
  • it does not get the output value 127, but also does not get the return value of the version
  • the version is returned, but does not match the protobuf jar version
  • the version is returned and it matches the protobuf jar version

You are experiencing a second problem.

If you try to run protoc --version from the command line, will this work?

As they claim on their website, if you have several versions of protoc on your system, you can set the HADOOP_PROTOC_PATH environment variable in the assembly shell to indicate the one you want to use to build Hadoop. If you do not define this environment variable, protoc looked up in PATH . Is this available on your PATH ?

If you have not installed the Buffer protocol compiler, you can download it from the following location: https://developers.google.com/protocol-buffers/docs/downloads

+6
source

It seems that you are missing the protoc compiler.

You can download and install the binary 2.5.0 from here

You can then install HADOOP_PROTOC_PATH to point to the installation directory.

0
source

Source: https://habr.com/ru/post/1204398/


All Articles