From 221e801561c92e9ed7e0411dd24bc1db8b3a1d41 Mon Sep 17 00:00:00 2001 From: Karl Tauber Date: Thu, 23 Dec 2021 22:19:29 +0100 Subject: [PATCH] support relative path in system property `flatlaf.nativeLibraryPath` (PR #453) --- .../src/main/java/com/formdev/flatlaf/FlatSystemProperties.java | 1 + .../src/main/java/com/formdev/flatlaf/util/NativeLibrary.java | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/flatlaf-core/src/main/java/com/formdev/flatlaf/FlatSystemProperties.java b/flatlaf-core/src/main/java/com/formdev/flatlaf/FlatSystemProperties.java index 1f301d85..08ca5dc3 100644 --- a/flatlaf-core/src/main/java/com/formdev/flatlaf/FlatSystemProperties.java +++ b/flatlaf-core/src/main/java/com/formdev/flatlaf/FlatSystemProperties.java @@ -141,6 +141,7 @@ public interface FlatSystemProperties /** * Specifies a directory in which the native FlatLaf library have been extracted. + * The path can be absolute or relative to current application working directory. * This can be used to avoid extraction of the native libraries to the temporary directory at runtime. * * @since 2 diff --git a/flatlaf-core/src/main/java/com/formdev/flatlaf/util/NativeLibrary.java b/flatlaf-core/src/main/java/com/formdev/flatlaf/util/NativeLibrary.java index 1f695c28..a406a85b 100644 --- a/flatlaf-core/src/main/java/com/formdev/flatlaf/util/NativeLibrary.java +++ b/flatlaf-core/src/main/java/com/formdev/flatlaf/util/NativeLibrary.java @@ -135,7 +135,7 @@ public class NativeLibrary private boolean loadLibraryFromFile( File libraryFile ) { try { - System.load( libraryFile.getPath() ); + System.load( libraryFile.getAbsolutePath() ); return true; } catch( Throwable ex ) { log( null, ex );