Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

getting JAVA_HOME is incorrectly set with hadoop

Tags:

I just downloaded hadoop and unzipped the file. but when I run hadoop version command from command prompt , I'm getting below error . I double check and JAVA_HOME is set to "C:\Program Files\Java\jdk1.8.0_45\bin" which looks ok to me .

C:\Users\shri-pc>hadoop version
The system cannot find the path specified.
Error: JAVA_HOME is incorrectly set.
       Please update C:\JAVA\hadoop-2.6.0\conf\hadoop-env.cmd
'-Xmx512m' is not recognized as an internal or external command,
operable program or batch file.

Output of java -version command is coming properly . Please advice .

C:\Users\shri-pc>java -version
java version "1.8.0_51"
Java(TM) SE Runtime Environment (build 1.8.0_51-b16)
Java HotSpot(TM) Client VM (build 25.51-b03, mixed mode)
like image 268
Shri S Softwares Avatar asked Aug 22 '15 19:08

Shri S Softwares


People also ask

How do I fix Java Home error?

Download Liberica JDK and on installation it will automatically set JAVA_HOME environment variable. Now you just go to Android Studio -> Project Structure -> SDK -> Point all jdk path to liberica jdk installation directory and apply. You are done. Just restart android studio and gradle command will work.

How do you fix please set the JAVA_HOME variable in your environment to match the location of your Java installation?

To set JAVA_HOME, do the following: 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.

How do you check JAVA_HOME path is set or not?

Verify JAVA_HOMEOpen a Command Prompt window (Win⊞ + R, type cmd, hit Enter). Enter the command echo %JAVA_HOME% . This should output the path to your Java installation folder. If it doesn't, your JAVA_HOME variable was not set correctly.

What happens if JAVA_HOME is not set?

If any program that requires a Java runtime fails to find the JAVA_HOME environment variable upon startup, or if the JAVA_HOME environment variable is misconfigured, it will result in some of the following error messages to be displayed: A Java installation exists but JAVA_HOME has been set incorrectly.


1 Answers

Issue was with space in JAVA_HOME path . I change the path as below and it started working.

from -

"C:\Program Files\Java\jdk1.8.0_45\bin"

to -

"C:\PROGRA~1\Java\jdk1.8.0_45\bin"

.

like image 128
Shri S Softwares Avatar answered Oct 25 '22 06:10

Shri S Softwares