开发者

Why does QuickTime QTSession.open fail when packaged using OSX Jar Bundler?

开发者 https://www.devze.com 2022-12-13 05:46 出处:网络
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 t

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/Exten开发者_开发问答sions/libQTJNative.jnilib: no suitable image found. Did find: /System/Library/Java/Extensions/libQTJNative.jnilib: no matching architecture in universal wrapper


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.


I also found... you java application with java -d32 ...

(ref: http://macintoshnotes.wordpress.com/2009/12/07/quicktime-for-java-under-snow-leopard/)

0

精彩评论

暂无评论...
验证码 换一张
取 消