summaryrefslogtreecommitdiff
path: root/jurt
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2014-02-13 23:20:28 +0100
committerStephan Bergmann <sbergman@redhat.com>2014-02-13 23:22:35 +0100
commit0d396800021684a8c0875e45ed1440011fd7f9b0 (patch)
treed7f792c59ad954edeafe58571e3c17efdb842114 /jurt
parentf759239d7d4a7c9d9fc641f1873a34c5a4d6c31b (diff)
More java.lang.System.mapLibraryName dylib vs. jnilib confusion
...like a76261ac9e40eb57e942db2c7aea8b8a5e904ff2 Change-Id: I803dc81344efb5e8021d9ef4146c06ecf82ca63b
Diffstat (limited to 'jurt')
-rw-r--r--jurt/com/sun/star/lib/util/NativeLibraryLoader.java11
1 files changed, 10 insertions, 1 deletions
diff --git a/jurt/com/sun/star/lib/util/NativeLibraryLoader.java b/jurt/com/sun/star/lib/util/NativeLibraryLoader.java
index 9a98cfcd7024..749dcb1378c3 100644
--- a/jurt/com/sun/star/lib/util/NativeLibraryLoader.java
+++ b/jurt/com/sun/star/lib/util/NativeLibraryLoader.java
@@ -43,7 +43,16 @@ public final class NativeLibraryLoader {
library name is system dependent
*/
public static void loadLibrary(ClassLoader loader, String libname) {
- File path = getResource(loader, 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";
+ }
+ File path = getResource(loader, sysname);
if (path == null) {
// If the library cannot be found as a class loader resource, try
// the global System.loadLibrary as a last resort: