Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
Re: jni problems ?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: jni problems ?



Are you running from a bundled double-clickable Java application stub? If your stub contains an x86_64 architecture, it will try to load your app in first 64-bit capable JVM it finds in Java Preferences.

You need to either remove the x86_64 architecture using the lipo tool, or add the LSArchitecturePriority key and dictionary values to your Info.plist to ensure the "Run in 32-bit mode" checkbox is checked.

Best of luck,
Mike Swingler
Java Runtime Engineer
Apple Inc.

On Jun 23, 2009, at 2:06 PM, Lars Gustafsson wrote:

I have tried the -d32 option & I have J2SE 5.0 32 bits selected as my preferred JVM,
but still the same error.



Message: 2
Date: Mon, 22 Jun 2009 12:21:20 -0700
From: Greg Guerin <email@hidden>
Subject: Re: jni problems ?
To: list Java-dev <email@hidden>
Message-ID: <email@hidden>
Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed

Lars Gustafsson wrote:

When trying to call "DNSSDService b = DNSSD.browse(typeName,
this);" on a Intel Mac, it fails when running an app created with
the JarBundler ant-task.

On a G4 it works, and when creating a executable jaj-file it works
on all plattforms.

2009-06-22 20.47.12 [0x0-0x41041].AxeptX-1.13[3431] Exception in
thread "AWT-EventQueue-0" 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

This error strongly suggests that you are using a 64-bit JVM, and that the jnilib does not contain any 64-bit code. "No matching architecture" is the main signifier.

I have already confirmed that the jnilib does not contain 64-bit
code, using this command-line in Terminal.app:

 file /usr/lib/java/*dns*

So, are you using a 64-bit JVM?  If so, is this a requirement, or can
you use a 32-bit JVM?

 -- GG



------------------------------

Message: 3
Date: Mon, 22 Jun 2009 12:21:37 -0700
From: Pratik Solanki <email@hidden>
Subject: Re: jni problems ?
To: Lars Gustafsson <email@hidden>
Cc: email@hidden
Message-ID: <email@hidden>
Content-Type: text/plain; charset=us-ascii; format=flowed; delsp=yes

You are likely using 64-bit Java (Java 6?) and it is failing to load
that library because it is not built for 64-bit. Do a 'file /usr/lib/
java/libjdns_sd.jnilib' in Terminal to see what it says.

To fix it, pass -d32 to the java command and use Java SE 5.

Pratik
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Java-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden

_______________________________________________ Do not post admin requests to the list. They will be ignored. Java-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
References: 
 >Re: jni problems ? (From: Lars Gustafsson <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2011 Apple Inc. All rights reserved.