Loads the native library specified by the filename argument. The filename
argument must be an absolute path name.
(for example
Runtime.getRuntime().load("/home/avh/lib/libX11.so");).
If the filename argument, when stripped of any platform-specific library
prefix, path, and file extension, indicates a library whose name is,
for example, L, and a native library called L is statically linked
with the VM, then the JNI_OnLoad_L function exported by the library
is invoked rather than attempting to load a dynamic library.
A filename matching the argument does not have to exist in the file
system. See the JNI Specification for more details.
Otherwise, the filename argument is mapped to a native library image in
an implementation-dependent manner.
First, if there is a security manager, its checkLink
method is called with the filename as its argument.
This may result in a security exception.
This is similar to the method loadLibrary(String), but it
accepts a general file name as an argument rather than just a library
name, allowing any file of native code to be loaded.
The method System.load(String) is the conventional and
convenient means of invoking this method.
filename | the file to load. |
SecurityException | if a security manager exists and its
checkLink method doesn't allow
loading of the specified dynamic library | |
UnsatisfiedLinkError | if either the filename is not an absolute path name, the native library is not statically linked with the VM, or the library cannot be mapped to a native library image by the host system. | |
NullPointerException | if filename is
null |
java.lang.Runtime.getRuntime(), java.lang.SecurityException, java.lang.SecurityManager.checkLink(java.lang.String)
Diagram: System