Setting JAVA_HOME variable on Mac

$ edit ~/.profile

add line

export JAVA_HOME=`/usr/libexec/java_home -v 1.7`

SAVE

re-open Terminal

$ echo $JAVA_HOME
/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home

$

Please note that the most current version (1.6) is loading when 1.7 is missing.

No comments:

Post a Comment