I\'m trying to get Hadoop running \'Local Mode\' on my Windows machine. I\'ve been using this guide: http://hadoop.apache.org/docs/r1.2.1/single_node_setup.html
When
like the other answers, your java environment path must not contain space. The solution is as follows:
Try removing @ from @rem in hadoop-env.cmd and set JAVA_HOME=%JAVA_HOME%
rem The java implementation to use. Required.
set JAVA_HOME=%JAVA_HOME%
Then try running hdfs namenode -format
This solution worked for me
in hadoop-config.xml, the logic is
if not exist %JAVA_HOME%\bin\java.exe ( echo Error: JAVA_HOME is incorrectly set. echo Please update %HADOOP_HOME%\conf\hadoop-env.cmd goto :eof )
if your java environment path contains space, such as "C:\Program Files\java\xxxxx" , the word 《Program Files》 contains a space, so CMD can't identificate
SO your can change the path instead.
if your java environment path contains space, such as "C:\Program Files\java\xxxxx" , the word 《Program Files》 contains a space, so CMD can't identificate
this is the right answer
Use "%JAVA_HOME%" in conf\hadoop-env.cmd
set JAVA_HOME=C:\Program Files\Java\jdk1.8.0_131\
Above configuration was throwing same error as yours. I updated above with below in hadoop-env.cmd which is infact SFN
set JAVA_HOME=C:\Progra~1\Java\jdk1.8.0_131\
This allowed me to change/have different java version than that of system.