summaryrefslogtreecommitdiffstats
path: root/bundles
diff options
context:
space:
mode:
authorSilenio Quarti <silenio>2009-05-21 16:48:58 +0000
committerSilenio Quarti <silenio>2009-05-21 16:48:58 +0000
commit5b59ebe51ec7c30fcec37766713872d6ec4b2482 (patch)
tree3abdd2df8134c5b737e6f776495493da503cc2e8 /bundles
parentac621d92ba45de42f9d09f7fe662976525c4ad9b (diff)
downloadeclipse.platform.swt-5b59ebe51ec7c30fcec37766713872d6ec4b2482.tar.gz
eclipse.platform.swt-5b59ebe51ec7c30fcec37766713872d6ec4b2482.tar.xz
eclipse.platform.swt-5b59ebe51ec7c30fcec37766713872d6ec4b2482.zip
276564 - Eclipse won't launch using JDK 7 because SWT native libraries don't load
Diffstat (limited to 'bundles')
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/common_j2se/org/eclipse/swt/internal/Library.java17
1 files changed, 13 insertions, 4 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/common_j2se/org/eclipse/swt/internal/Library.java b/bundles/org.eclipse.swt/Eclipse SWT PI/common_j2se/org/eclipse/swt/internal/Library.java
index 1f47238b05..d166d5bdc3 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/common_j2se/org/eclipse/swt/internal/Library.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/common_j2se/org/eclipse/swt/internal/Library.java
@@ -201,8 +201,8 @@ public static void loadLibrary (String name, boolean mapName) {
}
libName1 = name + "-" + Platform.PLATFORM + "-" + version; //$NON-NLS-1$ //$NON-NLS-2$
libName2 = name + "-" + Platform.PLATFORM; //$NON-NLS-1$
- mappedName1 = System.mapLibraryName (libName1);
- mappedName2 = System.mapLibraryName (libName2);
+ mappedName1 = mapLibraryName (libName1);
+ mappedName2 = mapLibraryName (libName2);
} else {
libName1 = libName2 = mappedName1 = mappedName2 = name;
}
@@ -230,8 +230,8 @@ public static void loadLibrary (String name, boolean mapName) {
} else {
/* fall back to using the tmp directory */
if (IS_64) {
- fileName1 = System.mapLibraryName (libName1 + SUFFIX_64);
- fileName2 = System.mapLibraryName (libName2 + SUFFIX_64);
+ fileName1 = mapLibraryName (libName1 + SUFFIX_64);
+ fileName2 = mapLibraryName (libName2 + SUFFIX_64);
}
}
if (load (path + SEPARATOR + fileName1)) return;
@@ -248,4 +248,13 @@ public static void loadLibrary (String name, boolean mapName) {
throw new UnsatisfiedLinkError ("no " + libName1 + " or " + libName2 + " in swt.library.path, java.library.path or the jar file"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
+static String mapLibraryName (String libName) {
+ libName = System.mapLibraryName (libName);
+ String ext = ".dylib"; //$NON-NLS-1$
+ if (libName.endsWith(ext)) {
+ libName = libName.substring(0, libName.length() - ext.length()) + ".jnilib"; //$NON-NLS-1$
+ }
+ return libName;
+}
+
}