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 I run the command: bin/hadoop, I get the following error message:
Error: JAVA_HOME is incorrectly set. Please update C:...\hadoop-2.7.1\conf\hadoop-env.cmd
Inside hadoop-env.cmd
, I have the line:
set JAVA_HOME=%JAVA_HOME%
When I type echo %JAVA_HOME%
at the command line I get:
C:\Java\jdk1.0.8_51
Even if I change the line in hadoop-env.cmd
to:
set JAVA_HOME=C:\Java\jdk1.0.8_51
I get the same error...
How could it be that my JAVA_HOME
is incorrectly set?
Set JAVA_HOME: Right click My Computer and select Properties. On the Advanced tab, select Environment Variables, and then edit JAVA_HOME to point to where the JDK software is located, for example, C:\Program Files\Java\jdk1.
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.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With