diff --git a/modules/core/src/main/java/org/lwjgl/system/Library.java b/modules/core/src/main/java/org/lwjgl/system/Library.java index e2d087053a..f87a299fce 100644 --- a/modules/core/src/main/java/org/lwjgl/system/Library.java +++ b/modules/core/src/main/java/org/lwjgl/system/Library.java @@ -204,14 +204,15 @@ public static SharedLibrary loadNative(Class context, String name) { public static SharedLibrary loadNative(Class context, String name, boolean bundledWithLWJGL) { apiLog("Loading library: " + name); + String libName = Platform.get().mapLibraryName(name); + // METHOD 1: absolute path - if (new File(name).isAbsolute()) { - SharedLibrary lib = apiCreateLibrary(name); + if (new File(libName).isAbsolute()) { + SharedLibrary lib = apiCreateLibrary(libName); apiLog("\tSuccess"); return lib; } - String libName = Platform.get().mapLibraryName(name); SharedLibrary lib; // METHOD 2: org.lwjgl.librarypath diff --git a/modules/templates/src/main/kotlin/org/lwjgl/system/jawt/templates/jawt.kt b/modules/templates/src/main/kotlin/org/lwjgl/system/jawt/templates/jawt.kt index e43a9d8cda..406d7e01e8 100644 --- a/modules/templates/src/main/kotlin/org/lwjgl/system/jawt/templates/jawt.kt +++ b/modules/templates/src/main/kotlin/org/lwjgl/system/jawt/templates/jawt.kt @@ -10,7 +10,7 @@ import org.lwjgl.system.jni.* val jawt = "JAWTFunctions".nativeClass(JAWT_PACKAGE, prefix = "JAWT_", prefixMethod = "JAWT_", binding = simpleBinding( "jawt", - libraryExpression = """Configuration.JAWT_LIBRARY_NAME.get("jawt")""", + libraryExpression = """Configuration.JAWT_LIBRARY_NAME, "jawt", System.getProperty("java.home") + "/bin/jawt"""", callingConvention = CallingConvention.STDCALL )) { nativeDirective(