Saturday, August 29, 2009

How to upgrade Java from 1.5 to 1.6 on Mac OS X 10.4+

This is really simple.
Run the following command

Step 1: rm /usr/bin/java (if you are concerned, make a copy to backup)

Step 2:
"sudo ln -s /System/Library/Frameworks/JavaVM.framework/Versions/1.6/Commands/java /usr/bin/java"

Before upgrade:
"java -version"
java version "1.5.0_19"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_19-b02-304)
Java HotSpot(TM) Client VM (build 1.5.0_19-137, mixed mode, sharing)


After upgrade:
"java -version"
java version "1.6.0_13"
Java(TM) SE Runtime Environment (build 1.6.0_13-b03-211)
Java HotSpot(TM) 64-Bit Server VM (build 11.3-b02-83, mixed mode)

2 comments:

Anonymous said...

just wondering why you'd handle the symlink change this way when you can easily use the java utility app in utilities, and this isn't really upgrading, you're just swapping out the version from one to the other; doesn't even require you to delete the directory like you have in step 1.

Anonymous said...

I used the java preferences app in applications/utilities and that worked fine for me.