Java 1.6 on OS X

As a default java 1.5 is the enabled Java version on Mac OS X, however if you run an updated version of your OS X you can easily start using Java 1.6 instead – it is already there!  All there is to it is, that you need to enable it.

If you simply want to use Java 1.6 in your current terminal session, you can fire this command:

alias java=/System/Library/Frameworks/JavaVM.framework/Versions/1.6/Commands/java

From that point on, when you use your Terminal, Java 1.6 will be used.

Also, you can add that line to ~/.bash_login – well, at least if you are using bash, and then it will always be the java used when firing off “java” from the terminal.

And! You can change the link from /usr/java/bin to use the 1.6 version. Do this with these:

sudo rm /usr/bin/java
sudo ln -s /System/Library/Frameworks/JavaVM.framework/Versions/1.6/Commands/java /usr/bin/java

Personally I use the alias method. That was it for now. Have fun with Java 1.6.

This entry was posted in Mac, Nerdy. Bookmark the permalink. Both comments and trackbacks are currently closed.

One Comment