Oct 15, 2009

Java 1.6 for Mac OSX

Java 1.6 is not installed as default. You can download it from the
Apple Developer Connection (ADC) from the download section(if you are a member of ADC).

when you type java at the command line, it invokes /usr/bin/java which is really a link to the Java Framework.

Java Link

cmar$ ls -la /usr/bin/java
lrwxr-xr-x 1 root wheel 74 Apr 30 08:41 /usr/bin/java -> /System/Library/Frameworks/JavaVM.framework/Versions/Current/Commands/java

Switching you default

If you want to switch your default then you need to either modify the link /usr/java/bin
sudo ln -s /System/Library/Frameworks/JavaVM.framework/Versions/1.6/Commands/java /usr/bin/java
You might have to do "rm /usr/java/bin" first to remove the link before creating a new one.

Or you can just create an alias in your ~/.bash_login
alias java=/System/Library/Frameworks/JavaVM.framework/Versions/1.6/Commands/java

Reference

No comments: