summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2014-02-13 22:43:31 +0100
committerCaolán McNamara <caolanm@redhat.com>2014-02-14 10:25:46 +0000
commitb7bf74bd0a1ccd5f8c8732474bc3e180617481fb (patch)
treecd4878ce25c7ab8dae1da7d3f432c076aa5b087e
parent3ea079bb50cb3587b75373beb63665c63013b286 (diff)
fdo#74683: java.lang.System.mapLibraryName dylib vs. jnilib confusion
Change-Id: I8fd7b908613a90c983f2244383432dd50ba10cdb (cherry picked from commit a76261ac9e40eb57e942db2c7aea8b8a5e904ff2) Reviewed-on: https://gerrit.libreoffice.org/8035 Reviewed-by: Lionel Elie Mamane <lionel@mamane.lu> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r--connectivity/com/sun/star/sdbcx/comp/hsqldb/NativeLibraries.java14
1 files changed, 12 insertions, 2 deletions
diff --git a/connectivity/com/sun/star/sdbcx/comp/hsqldb/NativeLibraries.java b/connectivity/com/sun/star/sdbcx/comp/hsqldb/NativeLibraries.java
index db3d5f185ff8..866f550f0a1b 100644
--- a/connectivity/com/sun/star/sdbcx/comp/hsqldb/NativeLibraries.java
+++ b/connectivity/com/sun/star/sdbcx/comp/hsqldb/NativeLibraries.java
@@ -44,8 +44,18 @@ final class NativeLibraries {
} catch (UnsatisfiedLinkError e) {
ClassLoader cl = NativeLibraries.class.getClassLoader();
if (cl instanceof URLClassLoader) {
- URL url = ((URLClassLoader) cl).findResource(
- System.mapLibraryName(libname));
+ String sysname = System.mapLibraryName(libname);
+ // At least Oracle's 1.7.0_51 now maps to .dylib rather than
+ // .jnilib:
+ if (System.getProperty("os.name").startsWith("Mac")
+ && sysname.endsWith(".dylib"))
+ {
+ sysname
+ = sysname.substring(
+ 0, sysname.length() - "dylib".length())
+ + "jnilib";
+ }
+ URL url = ((URLClassLoader) cl).findResource(sysname);
if (url != null) {
try {
System.load(