How to Set $JAVA_HOME environment variable on Mac OS X

In this tutorial, we show you how to set $JAVA_HOME environment variable on latest or older Mac OSX. 1. Mac OSX 10.5 or later In Mac OSX 10.5 or later, Apple recommends to set the $JAVA_HOME variable to /usr/libexec/java_home, just export $JAVA_HOME in file ~/. bash_profile or ~/.profile. $ vim .bash_profile export JAVA_HOME=$(/usr/libexec/java_home) $ source … Continue reading How to Set $JAVA_HOME environment variable on Mac OS X