Re: Handling native libs within a Virtual Machine
Tom Marble wrote:
Current Debian Java Policy  in section "Chapter 2.1: Virtual Machines"
stipulates "If a virtual machine supports native code, it must include the
directory /usr/lib/jni in its search path for these dynamic libraries."
There is no rationale given for this policy choice and I fail to
see the advantage of it. On the other hand I can imagine the
- Multiple VM's, or different versions of the same VM, may use similarly
named native libraries which have different version dependencies.
In the aforementioned policy scheme there is no way to avoid such
a version clash.
- Each VM under /usr/lib/jvm/<vm-name>/ it would seem should be
self contained in that file hierarchy, insomuch as possible.
- Usually VM native libraries are required to implement the VM
itself and would not have any utility being exposed in
a "public path" as a native Java add-on library would
Shall this requirement be dropped for virtual machines?
JVMs should not put their native libraries into /usr/lib/jni, they
should just add '/usr/lib/jni' to the search path for
This allows the installation of JNI libraries for use with all
installed JVMs. Of course this only works if the JVMs also find the
corresponding Java libraries.
For Blackdown, we add '/usr/lib/jni' to the search path for
System.loadLibrary() and '/usr/share/java' to java.ext.dirs when the
VM was installed from a .deb. (Implemented in HotSpot's os_linux.cpp.)
Juergen Kreileder, Blackdown Java-Linux Team