diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2014-02-13 22:43:31 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2014-02-14 10:25:21 +0000 |
commit | 3804d1c27128992593fe2d770293bfb189d308b1 (patch) | |
tree | 3d6a4d459cc57731adf63687bf4a965339faff6c | |
parent | c225c859f11da09ff20b3eb2a9f81ea32b02f6f3 (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/8034
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.java | 14 |
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( |