Reputation: 8794
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?
Upvotes: 3
Views: 2993
Reputation: 1
I agree with Valko Sipuli.
I'm using Mac OS Yosemite and
JAVA_HOME=$(/usr/libexec/java_home)
did the trick for running ant.
Upvotes: 0
Reputation: 3755
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)
Upvotes: 9
Reputation: 1045
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.
Upvotes: 4