Search code examples
echojava-home

echo $JAVA_HOME not returning jdk location


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?


Solution

  • 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.