Finding and configuring JAVA_HOME on Mac OSX

Just so that I don’t forget…

While installing JBoss, I found that I need to setup my JAVA_HOME variable correctly.

After checking a couple of sites, I found the following to be a good way to figure out and setup JAVA_HOME variable on Mac OSX.

In a Terminal window, type

which java

This pointed to “/usr/bin/java“, which was a symbolic link to “/System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK/Commands/java“. This in turn was a symbolic link to “/System/Library/Frameworks/JavaVM.framework/Versions/1.4.2“.
So my JAVA_HOME was pointing to “/System/Library/Frameworks/JavaVM.framework/Versions/1.4.2/Home“.

In order to change the JAVA_HOME variable I found a very nice utility called “RCEnvironment” that let me setup all kind of environment variables, including JAVA_HOME, very nicely and easily.

Once I added a JAVA_HOME variable (and pointed it to Java 5 home using RCEnviornment, I logged out and back in again. My JAVA_HOME was setup as I wanted.

Comment on this blog post...