News from Oct 06, 2013

  2013/10/06
How To Set $JAVA_HOME Environment Variable On Mac OS X
Last changed: Oct 06, 2013 22:23 by Bartolomeo Sorrentino
Labels: java, macosx

In this article we show you how to set $JAVA_HOME environment variable on Mac OSX 10.5 or later.

Set the $JAVA_HOME variable to /usr/libexec/java_home, just export $JAVA_HOME in file ~/. bash_profile or ~/.profile as shown below

 
$ vim .bash_profile 
 
export JAVA_HOME=$(/usr/libexec/java_home)
 
$ source .bash_profile
 
$ echo $JAVA_HOME
/Library/Java/JavaVirtualMachines/1.7.0.jdk/Contents/Home

Orginal Article from Mkyong.com

Posted at 06 Oct @ 9:51 PM by Bartolomeo Sorrentino | 0 Comments