[英]Why does QuickTime QTSession.open fail when packaged using OSX Jar Bundler?
I am using QuickTime for Java to display video within a Java desktop application. 我正在使用QuickTime for Java在Java桌面应用程序中显示视频。 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:
当此应用程序构建为jar文件时,一切正常,但是由于某些原因,当我使用此maven插件将应用程序打包为本地OSX应用程序捆绑包时,使用以下代码:
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.
java.lang.UnsatisfiedLinkError:/System/Library/Java/Extensions/libQTJNative.jnilib:找不到合适的图像。 Did find: /System/Library/Java/Extensions/libQTJNative.jnilib: no matching architecture in universal wrapper
确实找到了:/System/Library/Java/Extensions/libQTJNative.jnilib:通用包装中没有匹配的体系结构
QuickTime for Java only works in 32-bit mode. QuickTime for Java仅适用于32位模式。 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.
尽管已将J2SE 5.0(32位)设置为Java应用程序的JVM,但似乎osxappbundle-maven-plugin创建的应用程序捆绑包默认运行在64位版本的JVM上。 Setting osxappbundle-maven-plugin to use a custom Info.plist that contains the following key:
将osxappbundle-maven-plugin设置为使用包含以下键的自定义Info.plist:
<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. 强制应用程序捆绑包以32位模式运行并解决问题。
Many thanks Vinegar for pointing me in the right direction. 非常感谢Vinegar为我指明了正确的方向。
I also found... you java application with java -d32 ... 我还发现...您使用Java -d32的Java应用程序...
(ref: http://macintoshnotes.wordpress.com/2009/12/07/quicktime-for-java-under-snow-leopard/ ) (参考: http : //macintoshnotes.wordpress.com/2009/12/07/quicktime-for-java-under-snow-leopard/ )
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.