Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

echo $JAVA_HOME not returning jdk location

Tags:

When I type in echo $JAVA_HOME, I get $JAVA_HOME instead of the location of the jdk. I set the path from the environment variables correctly:

Variable name : JAVA_HOME Variable value: C:\Program Files\Java\jdk1.7.0_25

what am I doing wrong?

like image 480
Aamare Avatar asked Apr 29 '14 18:04

Aamare


People also ask

What should echo $Java_home return?

The echo $JAVA_HOME command-line must return the complete path directory to java executable.

Where is my JDK home path?

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.

Why JAVA_HOME is not working?

Verify JAVA_HOME 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. Please make sure you're using the correct Java installation folder, or repeat the steps above.

What is JAVA_HOME environment variable?

JAVA_HOME is an operating system (OS) environment variable which can optionally be set after either the Java Development Kit (JDK) or the Java Runtime Environment (JRE) is installed. The JAVA_HOME environment variable points to the file system location where the JDK or JRE was installed.


1 Answers

Try echo %JAVA_HOME% instead of echo $JAVA_HOME.

The first is for Windows (I'm assuming it's windows based on your filepath), the one you're using is for Linux.

like image 81
user3507600 Avatar answered Sep 17 '22 15:09

user3507600