Pretty new to Java and also to Mac … I want to make sure JAVA_HOME is set so in other programs I can use its path.
So I did some Googling and here is what I got:
If I enter /usr/libexec/java_home in terminal I get this:
/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home
but if I enter echo $JAVA_HOME in terminal, I don’t get anything back.
Can you please tell me what is going on in here?
Thanks.
JAVA_HOME isn’t set by default on OSX. You can resolve this by opening terminal and executing the following:
This will cause JAVA_HOME to be set on startup (rather than just the current session), and immediately add it.