简体   繁体   中英

How to run java application bundled to .app on Mac OS X in 32 bit mode?

I have written a java application on Windows Vista, it uses Bonjour and works fine. When I run it on Mac OS X 10.5.8 with all updates installed as a .jar file it runs perfectly too. But when I create a bundle using Jar Bundler it fails with

"Uncaught exception in main method: java.lang.UnsatisfiedLinkError: /usr/lib/java/libjdns_sd.jnilib: no suitable image found. Did find: /usr/lib/java/libjdns_sd.jnilib: no matching architecture in universal wrapper".

I googled and relized that the problem is, that there is no 64-bit implementation for Bonjour protocol. So, I need .app to run in 32 bit mode as .jar does.
When I run the jar file :

java.version = 1.5.0_20 ; os.arch = i386 ; sun.arch.data.model = 32  

When I run the .app :

java.version = 1.5.0_20 ; os.arch = x86_64 ; sun.arch.data.model = 64 

I set up JVM Version in Jar Bundler to 1.5* , tried many options in Info.plist in .app bundle such as

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

but it does nothing.

Does anyone know a decision?

Just add to the Info.plist

JVMArchs i386

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM