Setting the $JAVA_HOME environment variable on OSX 10.5 or later

Setting the $JAVA_HOME environment variable on the Mac OS can be a little confusing. I hope this clears things up. Open either ~/.bash_profile or ~/.profile in your favorite editor. I am using TextMate and I prefer editing ~/.profile. Add “export JAVA_HOME=$(/usr/libexec/java_home)” to the file and save it. You can reload the current environment without logging[…]