This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
How the "library naming scheme" works loading dynamical libraries?
- From: Martin Egholm Nielsen <martin at egholm-nielsen dot dk>
- To: java at gcc dot gnu dot org
- Date: Tue, 13 Dec 2005 20:33:34 +0100
- Subject: How the "library naming scheme" works loading dynamical libraries?
Hi,
I just stumbled across:
http://gcc.gnu.org/ml/java/2002-11/msg00394.html
searching for how to implement and use gcj-natively-compiled shared
libraries loaded dynamically (R).
In short, this posting's example loads an implementation (named "bte")
of an interface (named "bi") dynamically at runtime using
"Class.forName("bte")" and having LD_LIBRARY_PATH pointing to the path
of the shared library.
Fine! However, I'm not quite familiar with the mechanism that tracks
down the implementation, "bte", located in the library "lib-bte.so".
Does the class loader search each and every library in LD_LIBRARY_PATH
for this implementation? In it does, when does it do - at gcj init-time
or at Class.forName() invocation-time?
In case the library to "search" is determined by the argument to
Class.forName(), how does one create and use a shared library with more
than just one "implementation"?
BR,
Martin Egholm