views:

103

answers:

1

I am using QuickTime for Java to display video within a Java desktop application. Everything works fine when this application is built as a jar file, but for some reason when I use this maven plugin to package the application to look like a native OSX application bundle, the following code:

try {
  QTSession.open();
} catch (Throwable t) {
  logger.error("QTSession was unable to open", e);
}

throws the following error:

java.lang.UnsatisfiedLinkError: /System/Library/Java/Extensions/libQTJNative.jnilib: no suitable image found. Did find: /System/Library/Java/Extensions/libQTJNative.jnilib: no matching architecture in universal wrapper

+2  A: 

QuickTime for Java only works in 32-bit mode. Despite having J2SE 5.0 (32-bit) set as the JVM for java applications, it would seem as though application bundles created by the osxappbundle-maven-plugin defaults to run on a 64-bit version of the JVM. Setting osxappbundle-maven-plugin to use a custom Info.plist that contains the following key:

<key>LSArchitecturePriority</key>
<array>
<string>i386</string>
<string>ppc</string>
</array>

Forces the application bundle to run in 32-bit mode and resolves the issue.

Many thanks Vinegar for pointing me in the right direction.

Clinton
My pleasure. Thanks to you for giving the solution here, so it may help others in future.
Adeel Ansari