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)
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.
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.
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.
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.
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"
.
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