Package com.formdev.flatlaf.util
Class NativeLibrary
- java.lang.Object
-
- com.formdev.flatlaf.util.NativeLibrary
-
public class NativeLibrary extends Object
Helper class to load native library (.dll, .so or .dylib) stored in Jar.Copies native library to users temporary folder before loading it.
- Since:
- 1.1
-
-
Constructor Summary
Constructors Constructor Description NativeLibrary(File libraryFile, boolean supported)
Load native library from given file.NativeLibrary(String libraryName, boolean supported)
Load native library usingSystem.loadLibrary(String)
.NativeLibrary(String libraryName, ClassLoader classLoader, boolean supported)
Load native library from given classloader.
-
-
-
Constructor Detail
-
NativeLibrary
public NativeLibrary(String libraryName, ClassLoader classLoader, boolean supported)
Load native library from given classloader.Note regarding Java Platform Module System (JPMS): If classloader is
null
, the library can be only loaded from the module that contains this class. If classloader is notnull
, then the package that contains the library must be specified as "open" in module-info.java of the module that contains the library.- Parameters:
libraryName
- resource name of the native library (without "lib" prefix and without extension)classLoader
- the classloader used to locate the library, ornull
supported
- whether the native library is supported on the current platform
-
NativeLibrary
public NativeLibrary(File libraryFile, boolean supported)
Load native library from given file.- Parameters:
libraryFile
- the file of the native librarysupported
- whether the native library is supported on the current platform- Since:
- 2
-
NativeLibrary
public NativeLibrary(String libraryName, boolean supported)
Load native library usingSystem.loadLibrary(String)
. Searches for the library in classloader of caller (usingClassLoader.findLibrary(String)
) and in paths specified in system propertiessun.boot.library.path
andjava.library.path
.- Parameters:
libraryName
- name of the native library (without "lib" prefix and without extension)supported
- whether the native library is supported on the current platform- Since:
- 2.6
-
-