Sure. The VM will call the class loader of the class calling 
System.loadLibrary. The class loader's findLibrary method wont know of the 
library, so the VM will look in a standard place like LD_LIBRARY_PATH will 
be consulted.

Did you try this out?
-- 

BJ Hargrave
Senior Technical Staff Member, IBM
OSGi Fellow and CTO of the OSGi Alliance
[email protected]

office: +1 386 848 1781
mobile: +1 386 848 3788




From:
Ikuo Yamasaki <[email protected]>
To:
OSGi Developer Mail List <[email protected]>
Date:
2010/04/26 21:22
Subject:
[osgi-dev] loading native code outside of the bundle
Sent by:
[email protected]



Hi OSGi Experts,

I have a question on using native code in OSGi.

----
[Assumption]

- The native code "samplenative.so" exists in LD_LIBRARY_PATH on Linux.
- The jar file of bundle A does not "samplenative.so".

[Question]

- Can bundle A load the native code ?
                 by calling System.loadLibrary("samplenative").
----

It seems to me that R4.2 core spec says 
                 "No, all native codes to be loaded must be in the JAR and
                 specified in the Bundle-NativeCode header".

Best regards, 

---------------------
NTT Cyber Solutions Laboratories

     Ikuo YAMASAKI
        E-mail: [email protected]
TEL +81-46-859-8537  FAX +81-46-855-1282 


_______________________________________________
OSGi Developer Mail List
[email protected]
https://mail.osgi.org/mailman/listinfo/osgi-dev

_______________________________________________
OSGi Developer Mail List
[email protected]
https://mail.osgi.org/mailman/listinfo/osgi-dev

Reply via email to