What path does one specify for JAVA_HOME on a Mac OS environment?
Question
When an application or plug-in install states that the JAVA_HOME variable point you my JDK, what export statement do I need to put in my .bash_profile?
Solution
Browse to: /System/Library/Frameworks/JavaVM.Framework/Versions/
Then, pick an alias to a version or 'CurrentJDK'.
export JAVA_HOME=/System/Library/Frameworks/JavaVM.Framework/Versions/CurrentJDK/Home
then add $JAVA_HOME to your PATH.
OTHER TIPS
The proper way to set JAVA_HOME is to invoke the java_home(1)
tool (see http://developer.apple.com/library/mac/#qa/qa1170/_index.html). This can be done as follows to use defaults:
export JAVA_HOME=$(/usr/libexec/java_home)
I agree with Valko Sipuli.
I'm using Mac OS Yosemite and
JAVA_HOME=$(/usr/libexec/java_home)
did the trick for running ant.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow