Using Java 1.6 (Java 6) on Mac OSX

 

If you have Mac OSX Leopard then you should have both 1.5 and 1.6 installed on the system but by default 1.5 is used.

 

To check which version is being used when you log in, open up terminal and type:

 

java -version

 

You should see something like:

 

java version .1.5.0_16.

Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_16-b06-284)

Java HotSpot(TM) Client VM (build 1.5.0_16-133, mixed mode, sharing)

 

To switch this to use 1.6 instead, you need to add the following to your .bashrc:

 

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

export JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Versions/1.6/

 

Remember to either exit your terminal and start a new session or just run the command:

 

source ~/.bashrc

 

for the changes to take effect.