1

I am trying to install hadoop on my windows machine. I am following this guide: https://wiki.apache.org/hadoop/Hadoop2OnWindows but when I have to execute this line:

mvn package -Pdist,native-win -DskipTests -Dtar 

I have this error:

[ERROR] Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.2:exec (com
pile-ms-winutils) on project hadoop-common: Command execution failed. Process ex
ited with an error: 1(Exit value: 1) -> [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
I already read this post build hadoop 2.2 on windows but I am not able to understand how to solve.

Thank you in advance for your help.

Alex

Community
  • 1
  • 1
Lato
  • 33
  • 8

2 Answers2

3

You ran that command from a Windows SDK Command Prompt, right? Taking a look at this guide I wrote recently and make sure you have the proper tools installed.

aoetalks
  • 1,741
  • 1
  • 13
  • 26
-1

If you are using recent versions of Hadoop, i.e. Hadoop-2.8, or 2.7 then there is no need to built the Hadoop-src using Maven, there is an easy way to configure (higher versions) Hadoop in windows.

Download & Install Java in c:/java/

make sure the path is this way, if java is installed in program files, then hadoop-env.cmd will not recognize java path

Download Hadoop binary distribution.

I am using binary distribution Hadoop-2.8.1

Set Environment Variables:

JAVA_HOME = "c:/Java"
HADOOP_HOME="<your hadoop home>"
Path= "JAVA_HOME/bin"
Path = "HADOOP_HOME/bin" 

Hadoop will work on windows if Hadoop-src is built using maven in your windows machine. Building the Hadoop-src(distribution) will create a Hadoop binary distribution, which will work as windows native version.

But if you don't want to do that, then download pre-builted winutils of Hadoop distribution. Here is a GitHub link, which has winutils of some versions of Hadoop.

if the version you are using is not in the list, the follow the conventional method for setting up Hadoop on windows - link

If you found your version, then copy paste all content of folder into path: /bin/

Set all the .xml configuration files - Link & set JAVA_HOME path in hadoop-env.cmd file

From cmd go to:

<HADOOP_HOME>/bin/> hdfs namenode -format
<HADOOP_HOME>/sbin> start-all.cmd

Hope this helps.

Raxit Solanki
  • 434
  • 6
  • 15
  • While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. – pirho Dec 05 '17 at 09:11
  • Thanks for mentioning. The link has my own answer, but still I will post the original answer. – Raxit Solanki Dec 05 '17 at 09:19
  • 1
    Ok, it might not then be deleted from SO. I'm still not sure if copying is the best solution instead consider flagging question as a duplicate to the one you already answered. – pirho Dec 05 '17 at 09:21
  • That would probably be a optimistic way to answer the question. Thanks for the pointing out. – Raxit Solanki Dec 05 '17 at 09:25
  • Also when you reach 50 rep you can put the link to answer as a comment if not dare to mark as duplicate. – pirho Dec 05 '17 at 09:34
  • Some times questions are not identically similar, but answers match, so I find it a bit unfair to mark it as duplicate or down vote. – Raxit Solanki Dec 05 '17 at 09:37
  • It is true. Therefore commenting should be then considered. – pirho Dec 05 '17 at 09:38
  • Actually I did the same, but still I got down vote from you. :D – Raxit Solanki Dec 05 '17 at 09:39
  • It should not matter but it was not from me :) I prefer to give comments & advice to get this site better. – pirho Dec 05 '17 at 09:41
  • Anyways thanks for mentioning. Will improve in next answer. – Raxit Solanki Dec 05 '17 at 09:43