summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--bean/com/sun/star/beans/LocalOfficeConnection.java9
-rw-r--r--jurt/com/sun/star/lib/util/NativeLibraryLoader.java11
2 files changed, 19 insertions, 1 deletions
diff --git a/bean/com/sun/star/beans/LocalOfficeConnection.java b/bean/com/sun/star/beans/LocalOfficeConnection.java
index dd2ed076ae9d..d8e7b3baa654 100644
--- a/bean/com/sun/star/beans/LocalOfficeConnection.java
+++ b/bean/com/sun/star/beans/LocalOfficeConnection.java
@@ -78,6 +78,15 @@ public class LocalOfficeConnection
// load libofficebean.so/officebean.dll
String aSharedLibName = getProgramPath() + java.io.File.separator +
System.mapLibraryName(OFFICE_LIB_NAME);
+ // At least Oracle's 1.7.0_51 now maps to .dylib rather than .jnilib:
+ if (System.getProperty("os.name").startsWith("Mac")
+ && aSharedLibName.endsWith(".dylib"))
+ {
+ aSharedLibName
+ = aSharedLibName.substring(
+ 0, aSharedLibName.length() - "dylib".length())
+ + "jnilib";
+ }
System.load( aSharedLibName );
}
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: