Chris Su
Chris Su

Reputation: 543

Hadoop Installation: No such file while run hadoop format

I've checked answers on stackoverflow, no solutions work for my case.

Command:

bin/hadoop namenode -format

Error Message:

/bin/java: No such file or directory1.7.0_09/
/bin/java: No such file or directory1.7.0_09/
/bin/java: cannot execute: No such file or directory

Relevant change in hadoop_env.sh

# The java implementation to use.  Required.
export JAVA_HOME=/usr/local/jdk1.7.0_09/

I use soft-link by

ln -s "c:\Program Files\java\jdk1.7.0_09" /usr/local/jdk1.7.0_09

Java HOME:

C:\Program Files\Java\jdk1.7.0_09

Path :

C:\cygwin64\bin;C:\cygwin64\usr\sbin

If any one has clues, please feel free to point it out. Thanks.

Upvotes: 0

Views: 3997

Answers (3)

Chris Su
Chris Su

Reputation: 543

@xhudik @s.singh Finally! There is a problem when modifying hadoop_env.sh in Windows. I've fixed the problem with dos2unix command to eliminate dos style character. If dos2unix command can't be found in cygwin, re-download cygwin and update it.

Please follow the link here:

https://superuser.com/questions/612435/cygwin-dos2unix-command-not-found

The command is

dos2unix hadoop_env.sh 

Then everything is all set. Hope my experience would help others. Thanks for s.singh and xhudik's help.

Upvotes: 1

Sandeep Singh
Sandeep Singh

Reputation: 7990

Set your java home like this:

JAVA_HOME=C:/Program Files/java/jdk1.7.0_09 in hadoop_env.sh 

also you need to set Java Path in environment variable for java. If still getting issue, then please let us know.

For learning and best practice on hadoop, try using cloudera version or Hortonworks version of hadoop . You can download their windows version. Please check link: hortonworks. cloudera

Or you can use IBM Smart Cloud enterprise. IBM is giving free access for students and learning.

Upvotes: 0

xhudik
xhudik

Reputation: 2444

there is no java. Are you sure that your java binaries (./java , ./javac...) are in the specified directories? Maybe ln is a problem. Java also doesn't like " " in directory name (c:\program files) ...

You need to correctly place java distribution and then define JAVA_HOME variable. You can test it by:

$JAVA_HOME/bin/java -version

Upvotes: 0

Related Questions