Wednesday, April 30, 2014

Setting JAVA_HOME for OSX Mavericks


I have a copy of Oracle JDK 7 installed in my system.

Downloaded Maven2 from Homebrew and realized that Java_Home wasn't set correctly.

The fix:

To get the correct path, you will need to execute /usr/libexec/java_home to obtain the path.

To automatically set JAVA_HOME in terminal every time, append

export JAVA_HOME=`/usr/libexec/java_home`

to the end of ~/.bash_profile

You should be able to execute mvn in a new terminal.

No comments: