tags:

views:

154

answers:

2

How does one install set the JAVA5_HOME environment variable for Google Guava libraries on Mac OS 10.5.8?

+1  A: 

Add the following line to the end of /etc/profile (requires sudo access):

export JAVA5_HOME=/System/Library/Frameworks/JavaVM.framework/Home

If you have open terminal windows, you'll probably need to close and reopen them for this change to take effect.

Asaph
Actually, it's probably something more like /Library/Java/Home. But otherwise, that's the way to do it.
amphetamachine
@amphetamachine: Updated path. Thanks.
Asaph
A: 

It should probably be set to:

/System/Library/Frameworks/JavaVM.framework/Versions/1.5/Home

You can do this in your shell configuration file using something like:

export JAVA5_HOME='/System/Library/Frameworks/JavaVM.framework/Versions/1.5/Home'
mipadi
Don't set `JAVA_HOME` (or `JAVA5_HOME`) link to a specific version. The Java Preferences app on OSX dynamically points to different versions under different conditions. By setting to a specific version you may be asking for trouble.
Asaph
It won't cause trouble if an app specifically *needs* Java 5. If your Java Preferences are set to Java 6, but an app used from the command line *requires* Java 5, then you do need to set `JAVA_HOME` (or `JAVA5_HOME`) to the actual location.
mipadi
JAVA5_HOME environment variable is actually a build requirement for installing Google Guava libraries.