Mailing Lists: Apple Mailing Lists

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

Getting System.loadLibrary to use an already loaded JNI library



We have our own java launcher, based on the simpleJavaLauncher sample code. Before it creates and invokes the JVM it loads one of our JNI libraries, call it libFoo.jnilib, so as to call one of its methods. It does this using NSCreateObjectFileImageFromFile(), NSLinkModule(), NSLookupSymbolInModule(), etc. Later our Java code calls System.loadLibrary() for libFoo.jnilib, which loads a second copy of the library (verified with 'info sharedlibrary dyld' in gdb). Is there any way to get System.loadLibrary() to recognise that libFoo.jnilib is already loaded and use that copy rather than loading it again?

Mike Richmond
Global Graphics Software Ltd
_______________________________________________
java-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/java-dev
Do not post admin requests to the list. They will be ignored.




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.