JAVA_HOME is an environment variable used to locate the root of the Java installation.
Java is integrated into Mac OS X and Mac OS X releases starting with Panther (10.3) have supported multiple major versions of Java. Tiger (10.4), the current release, supports Java 1.3, 1.4, and 1.5.
Mac OS X has its own unique variation on a standard UNIX directory structure and there are sym-links galore to support the multiple versions of Java. This has created some confusion.
I have seen articles suggesting setting JAVA_HOME to /usr. $JAVA_HOME/bin then points to /usr/bin and /usr/bin contains sym-links for jar, java, javac, and others. But this suggestion fails for anything else that can be expected to reside in JAVA_HOME — like lib, include, docs, and even some tools that might be expected in bin.
The correct value for JAVA_HOME on Mac OS X Tiger is /Library/Java/Home.
For sh/bash/ksh add the following line to ~/.profile or /etc/profile:
export JAVA_HOME=/Library/Java/Home
For csh/tcsh add the following line to ~/.cshrc or /etc/csh.cshrc:
setenv JAVA_HOME /Library/Java/Home
For Aqua applications add JAVA_HOME to ~/.MacOSX/environment.plist.
Update Feb 22 2006:
The correct value for ANT_HOME on Mac OS X Tiger is /Developer/Java/Ant.
Comments