Getting back the Cocoa-Java bridge in Snow Leopard

Here's a hack that seems to restore the Cocoa-Java bridge on Snow Leopard. I have not tested it beyond a quick launch of one Cocoa-Java app. This is purely a data point that you can take for what it's worth. I offer no support and take no responsibility for what it may do to your system.

The trick is to copy two sets of files from a Leopard installation to the corresponding locations on the Snow Leopard installation:

  • the com directory in /System/Library/Java, and
  • the eight files ending with .dylib in /usr/lib/java (four of these are regular files, the other four are symlinks; if you prefer, you can copy just the files and recreate the symlinks by hand).

That's all.

A coworker figured most of this out. I'm not even sure how he did it. We were originally experimenting with instructions from OneSwarm.org for downgrading to Java 1.5, but that seems not to be necessary to get the Java bridge back.

Obviously if you're a developer you can't ship this hack with your product, but it might allow you to upgrade to Snow Leopard sooner if the only dealbreaker was the absence of the Java bridge.

7 thoughts on “Getting back the Cocoa-Java bridge in Snow Leopard

  1. I am able to do everything on the above, but cannot locate the 8 files stated in /usr/lib/java.

    I was only able to locate 6 files in location /Macintosh HD/Library/Home?shared_bundle/Libraries/*.dylib

    Please help.

  2. Thank you, thank you! Your instructions worked like a charm — I copied the com directory and the 4 dylib files, and then recreated the symlinks by hand. The Cocoa-Java app I needed to use (CocoaBooklet) now works again in 10.6! Made my day.

  3. Thanks Andy. This worked for me. I'm not sure if it is advised, but it worked. We'll see what happens when 10.7 comes out.

  4. So I upgraded to Lion… the upgrade left /System/Library/Java/com alone completely, but it cleaned out the files in /usr/lib/java. I put the Leopard version of these files (and symlinks) back in place. Unfortunately, that wasn't enough to get my Cocoa-Java applications working again. Maybe they're broken for good under Lion… bummer. Hope someone else has better luck than me.

  5. Ah, that is indeed a bummer. But the writing was on the wall anyway. I didn't expect this hack to work forever. Maybe someone will come up with a workaround that works for Lion.

  6. Hi, I don't have any leopard installation. Can anyone send or point me the leopard files? Where can I get those files if I don't have a leopard disk or installation?

Leave a Reply

Your email address will not be published. Required fields are marked *

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