How to set the JAVA_HOME variable in Mac OS X – maverick


Here’s what needs to be done:

– Start the Terminal.

$ vi ~/.bash_profile

… and paste the following (make it a single line):

export JAVA_HOME=/System/Library/Frameworks/
JavaVM.framework/Versions/CurrentJDK/Home

this set to java 1.6 or default installed in your mac.

But if you download and install jdk 1.7  which is pointing to /usr/bin/java

Set

export JAVA_HOME=/usr

echo $JAVA_HOME to check the java version

Maven uses JAVA_HOME value for java .

Note: I also tried creating and using the ~/.bashrc file, but that didn’t work (Mac OS 10.6.2), while ~/.bash_profile worked as expected.

 

 

One thought on “How to set the JAVA_HOME variable in Mac OS X – maverick

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s