Matt
Matt

Reputation: 616

HADOOP_HOME is not set correctly

I downloaded the binary tarball of hadoop from here: http://hadoop.apache.org/releases.html (ver 2.8.4). I unpacked the tar.gz file and then changed the etc/hadoop-env.sh from

export JAVA_HOME={$JAVA_HOME}

to my java jdk locaction:

export JAVA_HOME=C:\Program Files\Java\jdk1.8.0_131

I also added these two lines:

export HADOOP_HOME=D:/hadoop/hadoop-2.8.4 export PATH=$PATH:$HADOOP_HOME/bin

But when i try to run

$ hadoop version

from cmd i get an error message that says

Error: HADOOP_HOME is not set correctly

What did I do wrong and how should I change the hadoop_home path for it to work?

Upvotes: 0

Views: 9789

Answers (3)

LittleHealth
LittleHealth

Reputation: 122

I come across such error when I try to use hadoop-3.3.1, the latest version. I have searched a lot about "HADOOP_HOME not correctly set" and there are no useful results. But after I downgrade to hadoop-3.2.2, this error disappears.

I think you can try the non-latest version again.

Upvotes: 0

Roshan Bagdiya
Roshan Bagdiya

Reputation: 2178

Set the path HADOOP_HOME Environment variable as below:

export HADOOP_HOME=D:\hadoop\hadoop-2.8.4
export PATH=$PATH:$HADOOP_HOME\bin

$ hadoop version

It will work

Upvotes: 0

OneCricketeer
OneCricketeer

Reputation: 191681

Other than {$JAVA_HOME} has the dollar sign in the wrong spot (needs to be outside the brackets), Windows doesn't run the shell script to locate your variables

You need to set environment variables in Windows from the Control Panel. And you also need to remove all spaces from the file path of "Program Files"

Its not clear if you're using Cygwin or using Windows Linux subsystem, but it's different from the native CMD

Upvotes: 0

Related Questions