Many Java applications that use shell scripts to configure their environment use the JAVA_HOME
environment variable to start the correct version of Java, locate JRE JARs, and so on.
On OSX 10.6, the following paths seem to be valid for this variable
/Library/Java/Home
/System/Library/Frameworks/JavaVM.framework/Home
/System/Library/Frameworks/JavaVM.framework/Versions/Current
Some of these are symlinks to the actual current VM (as defined in the Java Preference pane).
But which one should be used—or is it okay to use any of them?
For Fish Shell users, use something like the following:
alias java7 "set -gx JAVA_HOME (/usr/libexec/java_home -v1.7)"