We recently finished migrating our product from Java5 to Java6. The software migration itself went quite smoothly with only a couple unanticipated problems.

However we do have a number of developers on MacBook Pro’s (myself included) that began having problems with other Java-based applications after making Java6 their default JVM.

One such problem was with the popular Spark IM client. After upgrading to Java6 we started getting the following exception:

macos:/Applications/Spark.app/Contents/MacOS ajordens$ ./JavaApplicationStub

NSRuntime.loadLibrary(/usr/lib/java/libObjCJava.dylib) error.

java.lang.UnsatisfiedLinkError: /usr/lib/java/libObjCJava.A.dylib:
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1822)
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1702)
at java.lang.Runtime.load0(Runtime.java:770)
at java.lang.System.load(System.java:1005)
at com.apple.cocoa.foundation.NSRuntime.loadLibrary(NSRuntime.java:127)

Revert back to Java6 and the problems disappeared.

Solution:

Reverting back to Java5 for a particular application was about the only suggestion I’ve seen that has actually worked.

Fortunately, you should be able to apply the change directly to the problem application’s Info.plist and not system-wide. Best of both worlds in a way.


Using the Spark example:

Edit /Applications/Spark.app/Contents/Info.plist and change the value associated with the JVMVersion key to be 1.5 instead of 1.5+.

Similar to a JNLP file, this will result in the runtime falling back to 1.5.0.


Leave a Comment




  • Pet Peeve: Don’t email my password to me in plain text You know the drill. Signup for some random service on the internet Receive a confirmation email with your account information or Forget a password for some random service ...

  • Eclipise Memory Analyzer (MAT) I must say the Eclipse Memory Analyzer looks pretty slick. There is some pretty good material over on the developers blog. Lastly, there was a talk on it ...

  • Open-source Web-based Code Review Tool: Rietveld Guido van Rossum, of Python fame, has recently released a Django-based application that enables web-based code reviews... Rietveld. It supports any language and currently can hook into Subversion repositories. You ...

  • An implementation of the JVM in Javascript? Caught this over on JavaPosse Google Groups. Essentially, some bright fellows over in Japan have developed a bytecode->javascript compiler. There's a demo floating around that took a Tetris ...

  • Facebook Chat? So it looks like the Facebook Chat service has finally started rolling out to my network (Facebook Chat has been mentioned previously). Not quite sure how ...