Fixing the error: JAVA_HOME is not set on a Mac
While setting up Nutch on a Mac, I kept getting this error in the terminal:
Error: JAVA_HOME is not set
To fix the error on OS X 10.6.x (Snow Leopard), enter the following at the command prompt:
export JAVA_HOME=$(/usr/libexec/java_home)
On 10.5 and above, the command line tool /usr/libexec/java_home dynamically finds the top Java version specified in Java Preferences for the current user. Using this method will allow the path to automatically change as software updates change Java versions.
Continue reading