Configuration#LIBRARY_NAME, Configuration#LIBRARY_PATH
| Modifier and Type | Field and Description |
|---|---|
| pack-priv static final String | |
| public static final String | JNI_LIBRARY_NAME
The LWJGL shared library name. |
| private static final Pattern | |
| private static final Pattern |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| private static void | |
| private static void | |
| pack-priv static Path | |
| private static Path | |
| pack-priv static URL | |
| private static String | |
| pack-priv static String | |
| private static byte[] | |
| private static byte[] | |
| public static void | |
| public static SharedLibrary | loadNative(String module, String name)
Calls |
| public static SharedLibrary | Returns: the shared librarythe class to use to discover the shared library in the classpath context, String the module to which the shared library belongs module, String the library name. OS-specific prefixes and file extensions are optional (e.g. both name)"GL" and "libGL.so.1" are
valid on Linux)Loads a shared library using OS-specific APIs (e.g. |
| public static SharedLibrary | Returns: the shared librarythe class to use to discover the shared library in the classpath context, String the module to which the shared library belongs module, String the library name. OS-specific prefixes and file extensions are optional (e.g. both name, boolean "GL" and "libGL.so.1" are
valid on Linux)whether the default LWJGL distribution includes the shared library. If true, LWJGL will also try to find the shared library under
the bundledWithLWJGL)<platform>/<arch>/<module> subfolder.Loads a shared library using OS-specific APIs (e.g. |
| private static SharedLibrary | loadNative(Class<?> context, String module, String name, boolean bundledWithLWJGL, boolean printError)
|
| private static SharedLibrary | |
| public static SharedLibrary | Returns: the shared librarya name, String... Configuration that specifies the library namethe default library name(s) defaultNames)Loads a shared library using |
| public static SharedLibrary | Returns: the shared librarya name, Supplier<SharedLibrary> Configuration that specifies the library namefallback to use if everything else fails fallback, String... the default library name(s) defaultNames)Loads a shared library using |
| private static SharedLibrary | loadNativeFromLibraryPath(Class<?> context, String module, String libName, boolean bundledWithLWJGL)
|
| private static SharedLibrary | |
| public static void | loadSystem(String module, String name)
Calls |
| public static void | loadSystem(Consumer<String>
should be the load, Consumer<String> System::load expression. This ensures that System.load has the same caller as this method.should be the loadLibrary, Class<?> System::loadLibrary expression. This ensures that System.loadLibrary has the same caller as this
method.the class to use to discover the shared library in the classpath context, String the module to which the shared library belongs module, String the library name. If not an absolute path, it must be the plain library name, without an OS specific prefix or file extension (e.g.
GL, not libGL.so) name)Loads a JNI shared library. |
| private static boolean | |
| private static boolean | |
| private static void | |
| pack-priv static void |
| JAVA_LIBRARY_PATH | back to summary |
|---|---|
| pack-priv static final String JAVA_LIBRARY_PATH | |
| JNI_LIBRARY_NAME | back to summary |
|---|---|
| public static final String JNI_LIBRARY_NAME The LWJGL shared library name. | |
| NATIVES_JAR | back to summary |
|---|---|
| private static final Pattern NATIVES_JAR | |
| PATH_SEPARATOR | back to summary |
|---|---|
| private static final Pattern PATH_SEPARATOR | |
| Library | back to summary |
|---|---|
| private Library() | |
| checkHash | back to summary |
|---|---|
| private static void checkHash(Class<?> context, Path libFile, String module, String libName) Compares the shared library hash stored in the classpath, with the hash of the actual library loaded at runtime. This check prints a simple warning when there's a hash mismatch, to help diagnose installation/classpath issues. It is not a security feature. | |
| detectPlatformMismatch | back to summary |
|---|---|
| private static void detectPlatformMismatch(Class<?> context, String module) | |
| findFile | back to summary |
|---|---|
pack-priv static Path findFile(String path, String module, String file, boolean bundledWithLWJGL)
| |
| findFile | back to summary |
|---|---|
private static Path findFile(String path, String file)
| |
| findResource | back to summary |
|---|---|
pack-priv static URL findResource(Class<?> context, String module, String resource, boolean bundledWithLWJGL)
| |
| getBundledPath | back to summary |
|---|---|
| private static String getBundledPath(String module, String resource) | |
| getRegularFilePath | back to summary |
|---|---|
pack-priv static String getRegularFilePath(URL url)
| |
| getSHA1 | back to summary |
|---|---|
| private static byte[] getSHA1(URL hashURL) throws IOException | |
| getSHA1 | back to summary |
|---|---|
| private static byte[] getSHA1(Path libFile) throws NoSuchAlgorithmException, IOException | |
| initialize | back to summary |
|---|---|
| public static void initialize() Ensures that the LWJGL shared library has been loaded. | |
| loadNative | back to summary |
|---|---|
| public static SharedLibrary loadNative(String module, String name) Calls | |
| loadNative | back to summary |
|---|---|
| public static SharedLibrary loadNative(Class<?> context, String module, String name) Loads a shared library using OS-specific APIs (e.g.
| |
| loadNative | back to summary |
|---|---|
| public static SharedLibrary loadNative(Class<?> context, String module, String name, boolean bundledWithLWJGL) Loads a shared library using OS-specific APIs (e.g.
| |
| loadNative | back to summary |
|---|---|
private static SharedLibrary loadNative(Class<?> context, String module, String name, boolean bundledWithLWJGL, boolean printError)
| |
| loadNative | back to summary |
|---|---|
private static SharedLibrary loadNative(Class<?> context, String module, String libName, boolean bundledWithLWJGL, String property, String paths)
| |
| loadNative | back to summary |
|---|---|
| public static SharedLibrary loadNative(Class<?> context, String module, Configuration<String> name, String... defaultNames) Loads a shared library using
| |
| loadNative | back to summary |
|---|---|
| public static SharedLibrary loadNative(Class<?> context, String module, Configuration<String> name, Supplier<SharedLibrary> fallback, String... defaultNames) Loads a shared library using
| |
| loadNativeFromLibraryPath | back to summary |
|---|---|
private static SharedLibrary loadNativeFromLibraryPath(Class<?> context, String module, String libName, boolean bundledWithLWJGL)
| |
| loadNativeFromSystem | back to summary |
|---|---|
private static SharedLibrary loadNativeFromSystem(String libName)
| |
| loadSystem | back to summary |
|---|---|
| public static void loadSystem(String module, String name) throws UnsatisfiedLinkError Calls | |
| loadSystem | back to summary |
|---|---|
| public static void loadSystem(Consumer<String> load, Consumer<String> loadLibrary, Class<?> context, String module, String name) throws UnsatisfiedLinkError Loads a JNI shared library.
| |
| loadSystem | back to summary |
|---|---|
| private static boolean loadSystem(Consumer<String> load, Class<?> context, String module, String libName, boolean bundledWithLWJGL, String property, String paths) | |
| loadSystemFromLibraryPath | back to summary |
|---|---|
| private static boolean loadSystemFromLibraryPath(Consumer<String> load, Class<?> context, String module, String libName, boolean bundledWithLWJGL) | |
| printError | back to summary |
|---|---|
| private static void printError(boolean bundledWithLWJGL) | |
| printError | back to summary |
|---|---|
| pack-priv static void printError(String message) | |