Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: JNI work fine with default Java5 but not with javase6dp8




On 21-Apr-08, at 6:10 PM, Greg Guerin wrote:

Youssef wrote:

Now, 'file' command tell me that all *.dylib in usr/lib/java (par
consequent,libObjCJava)gives this output.

file /usr/lib/java/libObjCJava.A.dylib
/usr/lib/java/libObjCJava.A.dylib: Mach-O universal binary with 2
architectures
/usr/lib/java/libObjCJava.A.dylib (for architecture i386): Mach-O
dynamically linked shared library i386
/usr/lib/java/libObjCJava.A.dylib (for architecture ppc7400): Mach-O
dynamically linked shared library ppc

Why do you need to link to libObjCJava.A.dylib?
because of this. Before thinking to build and call directly my native code, my java classes called directely NSDistributedNotificationcenter constructor (deprecated since i don't found an other class replacing it, this is an other headache ). but this constructor throw this exception:
NSRuntime.loadLibrary(/usr/lib/java/libObjCJava.dylib) error.
java.lang.UnsatisfiedLinkError: /usr/lib/java/libObjCJava.A.dylib:
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1822)
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1702)
at java.lang.Runtime.load0(Runtime.java:770)
at java.lang.System.load(System.java:1005)
at com.apple.cocoa.foundation.NSRuntime.loadLibrary(NSRuntime.java:127)
at com.apple.cocoa.foundation.NSRuntime.<clinit>(NSRuntime.java:35)
at com.apple.cocoa.foundation.NSObject.<clinit>(NSObject.java: 27)
the same error that i have had when cc commandline generated 32-bit by default rather than 64-bit.
From this error, I think that calling NSDistributedNotificationcenter ,automatically calls libObjCJava.dylib and found that this lib is for 32-bit architecture only.
-Ucef



Or why do you think you need to?



does this means that I cannot use thoses dylib anywhere in my machine to
call Obj-C app?

Please explain what you mean by "call Obj-C app", and why you think libObjCJava.A.dylib is necessary to do it.

We need a better description of what you're trying to accomplish. So far,
the only description you've given is for a JNI lib called by a Java class.
Suddenly libObjCJava.A.dylib seems to be necessary, even though it wasn't
necessary for the JNI-lib you were using before. Overall, you haven't said
what you're building, how it uses Objective-C, where you got the source
from, or what you're trying to do.


 -- GG


_______________________________________________ Do not post admin requests to the list. They will be ignored. Java-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/java-dev/email@hidden

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: http://lists.apple.com/mailman/options/java-dev/email@hidden

This email sent to email@hidden
References: 
 >Re: JNI work fine with default Java5 but not with javase6dp8 (From: Greg Guerin <email@hidden>)



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

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.