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: Unloading a JNI lib at runtime



from http://www.chongluo.com/books/unix3/mac/ch05_03.htm

Mach-O shared libraries have the file type MH_DYLIB and the .dylib (dynamic library) suffix and can be linked to with static linker flags. So, if you have a shared library named libcool.dylib, you can link to this library by specifying the -lcool flag. Although shared libraries cannot be loaded dynamically as modules, they can be loaded through the dyld API (see the manpage for dyld, the dynamic link editor). It is important to point out that shared libraries cannot be unloaded.

so if your jnilib is dynamic library it can not be unloaded

if your jnilib is a bundle maybe it's possible but I'm not sure



On Apr 1, 2005, at 6:05 PM, Moises Lejter wrote:

OL&L Lists wrote:

The problem I am having is that while my applet is still running, I can't seem to get the older lib to unload and have the applet use the newer one.[...]
Does anyone know how to do this in Java 2 using a JNI lib on OS X 10.3?

I have a vague memory that native libraries are linked into a JVM on a class-loader-specific basis, and I have another vague memory that there is no unload() for native libraries ... So (if those are both accurate :-) ), I would suggest that you would need to load your app using a new class loader, and when appropriate create another class loader so as to reload your code and its supporting native lib...


Moises


_______________________________________________ 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


Dmitry Markman

_______________________________________________
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: 
 >Unloading a JNI lib at runtime (From: OL&L Lists <email@hidden>)
 >Re: Unloading a JNI lib at runtime (From: Moises Lejter <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.