duffymo
duffymo

Reputation: 308988

Running Hadoop On Windows 7

I'm having trouble running Hadoop 1.0.3 on Windows 7 64-bit.

I'm following directions from this link. I've downloaded Cygwin and successfully started the SSH daemon. I unpacked Hadoop into the Cygwin /usr/local folder using Win-Zip 16.5. I edited the hadoop-env.sh to point to my JDK using MetaPad:

export JAVA_HOME="C:\\Program Files\\Java\\jdk1.7.0_02"

I ran dos2unix to make sure that I didn't have any issues with characters.

But when I run the hadoop command in Cygwin terminal to get the version I see this:

$ bin/hadoop version
bin/hadoop: line 2: $'\r': command not found
bin/hadoop: line 17: $'\r': command not found
bin/hadoop: line 18: $'\r': command not found
bin/hadoop: line 49: $'\r': command not found
: No such file or directoryn
bin/hadoop: line 52: $'\r': command not found
bin/hadoop: line 60: syntax error near unexpected token `$'in\r''
'in/hadoop: line 60: `case "`uname`" in

Michael@Michael-PC /usr/local/hadoop
$

Has anyone seen this? Is there an easy correction that I missed?

Upvotes: 1

Views: 3684

Answers (1)

hari_sree
hari_sree

Reputation: 1538

Seems like carriage return difference between unix and windows is causing the problem . Try running dos2unix on the shell script

Go to the hadoop bin directory and try :

dos2unix.exe hadoop.sh

And then try the hadoop command .

Upvotes: 4

Related Questions