Mac OS X Snow Leopard Has No Java 5 – Warning!

Here’s one I spent a day learning: OS X 10.6 “Snow Leopard” has no Java 5 installed, despite appearances to the contrary.

The Java 1.5 installation is actually a symbolic link to the Java 1.6 installation. There is a fix available, which essentially entails copying the Java 1.5 installation from a Leopard install, and fixing up the symlinks. It’s available here.

I found this because we have a product which must be linked against Java 1.5, or rather, the JDBC version 3 specification. We don’t yet support all the extended functionality of JDBC 4.

In Eclipse, I had selected Java 5 (= JDBC 3) as the JRE, but was still getting lots of “method unimplemented” errors for JDBC 4 (= Java 6) signatures. These aren’t present in Java 5, so they should not have appeared.

After unfolding the JRE Library node in the Eclipse Package Explorer, it was clear that, although the JRE was reporting itself as Java 5, the jars within were clearly coming from Java 6.

I applied the fix and the compiler errors disappeared – Java 5/JDBC 3 was in use again.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.