Andy Lee's weblog

Main menu

Post navigation

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.

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.

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.