echo $JAVA_HOME not returning jdk location

Aamare picture Aamare · Apr 29, 2014 · Viewed 77.5k times · Source

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?

Answer

user3507600 picture user3507600 · Apr 29, 2014

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.