Skip to main content

Apple's Java Versions Directory Needs Some Love

Posted by garysweaver on June 23, 2010 at 11:27 AM PDT

First off, I want to thank Apple for being such big supporters of Java. You may have gone off and done your own thing, but as Java developers, we still have to give some serious kudos.

However, what has been going on with symlinks in the /System/Library/Frameworks/JavaVM.framework/Versions directory is wrong. If I remember correctly, I noticed this at first with the upgrade to Snow Leopard, and it seems to have continued to happen with each subsequent update since. (So this article is way late, but so be it.) Here's what it looks like: (I had to remove a few directories from the listing and others were there before from previous upgrades, so it may not look exactly the same as yours.)

May 24 09:15 1.3 -> 1.3.1
Jul 20  2009 1.3.1
May 24 09:15 1.4 -> CurrentJDK
May 24 09:15 1.4.2 -> CurrentJDK
May 24 09:15 1.5 -> CurrentJDK
May 24 09:15 1.5.0 -> CurrentJDK
May 24 09:15 1.6 -> 1.6.0
Nov 30  2009 1.6.0
May 24 09:15 A
May 24 09:15 Current -> A
May 24 09:15 CurrentJDK -> 1.6

Apple keeps pointing the symlinks for previous versions of Java at the Current/CurrentJDK directories which are Java 6.

I'm guessing that this is probably just for backwards compatibility with Apps for OS X that need to run on older Java versions, and Apple doesn't want to bother maintaining them? It is true that some older Java apps/libraries will work this way, even though I had a few that didn't. So the bulk of OS X users that aren't Java developers get some of their Java apps running. But, what about the large Java development community that uses OS X? What about those apps that don't work in Apple's Java 6?

I'm sure Apple feels that they are the benevolent dictator of this directory and that developers and everyone else should stay kindly out and use the Java Preferences app. But with articles out there discussing related issues with Java and Snow Leopard, I was really hoping that by now Apple would have done something. As far as I can tell after my most recent upgrade to OS X 10.6.4, they haven't.

So what am I getting at? I think that in future versions of OS X, Apple should stop messing with any symlinks in here. If they have OS X components that require Java 6, have them point at the 1.6 symlink, for example. If a completely new version of Java needs to be installed, and new symlinks need to be setup, that is fine. Tell OS X app developers somewhere that they should be pointing to the 1.4, 1.5, or 1.6 directory and not Current/CurrentJDK if they want to make sure it stays stable. But please don't mess with older version directories and symlinks like this. Maybe also undo the harm you did by providing 1.4 and 1.5 versions that work in OS X 10.6.x. Even if it means having to give up control, contracting a bunch of developers to migrate OS X's Java to OpenJDK, donating most of the code to that project, and decoupling Java from OS X completely... please just do something to make this better.

Edit: Apple seems to have done it yet again with Mac OS X 10.6 Update 4, messing with my Java 1.5.0-leopard install. See Recovering Lost Java 1.5.0 for Snow Leopard After Java for Mac OS X 10.6 Update 4 Install for more info, and be sure to see Using Java 1.5 and Java 1.4 on Snow Leopard by Ted Wise.

Related Topics >>



Learn it, love it. :) There are other alternatives to the Apple javaVM, which require a lot more work. However I think the reason is XCode back in the day had an option to build against the version and it would link to the correct framework. As a side note If you look at other OS X frameworks like Quicktime, or anything iPhone, should be set up similarly. Pointing the old 1.4 JDK's to 1.6 shouldn't hurt anything.

shouldn't hurt, but did

I'd love to love it, but I haven't so far. I've learned about as much as I want to about it unfortunately. "Pointing the old 1.4 JDK's to 1.6 shouldn't hurt anything" is incorrect. I had at least a few Java apps (older versions oXygen, DB Visualizer, etc. ) not work with Apple's Java 6 when we first upgraded to the original version supplied Snow Leopard prior to the service packs. Read everything you can find via search related to this and you'll see that this isn't fantasy.

If it does hurt (additional work required)

I think you can download the old sources from the old JDK's at: That should help you.