diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/Platform.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/Platform.java index dbf7dbc102e..fdf413b8e94 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/Platform.java +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/Platform.java @@ -21,7 +21,7 @@ public static boolean isLoadable () { } public static void exitIfNotLoadable() { - if (!Library.isLoadable ()) { + if (!Library.isLoadable (true)) { System.err.println("Libraries for platform " + Platform.PLATFORM + " cannot be loaded because of incompatible environment"); System.exit(1); } diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/common/org/eclipse/swt/internal/Library.java b/bundles/org.eclipse.swt/Eclipse SWT PI/common/org/eclipse/swt/internal/Library.java index 617831ee00c..32826554f66 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT PI/common/org/eclipse/swt/internal/Library.java +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/common/org/eclipse/swt/internal/Library.java @@ -13,15 +13,10 @@ *******************************************************************************/ package org.eclipse.swt.internal; -import java.io.File; -import java.io.IOException; -import java.io.InputStream; -import java.net.JarURLConnection; -import java.net.URL; -import java.net.URLConnection; -import java.nio.file.Files; -import java.nio.file.StandardCopyOption; -import java.util.jar.Attributes; +import java.io.*; +import java.net.*; +import java.nio.file.*; +import java.util.jar.*; public class Library { @@ -192,6 +187,10 @@ static boolean extract (String extractToFilePath, String mappedName) { } static boolean isLoadable () { + return isLoadable(false); +} + +static boolean isLoadable (boolean ignoreMissingManifest) { URL url = Platform.class.getClassLoader ().getResource ("org/eclipse/swt/internal/Library.class"); //$NON-NLS-1$ if (!url.getProtocol ().equals ("jar")) { //$NON-NLS-1$ /* SWT is presumably running in a development environment */ @@ -218,6 +217,9 @@ static boolean isLoadable () { if (arch.equals (manifestArch) && os.equals (manifestOS)) { return true; } + if (manifestArch == null && manifestOS == null && ignoreMissingManifest) { + return true; + } return false; } diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/Platform.java b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/Platform.java index af2f17d7b92..3b81e1802a0 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/Platform.java +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/Platform.java @@ -22,7 +22,7 @@ public static boolean isLoadable () { } public static void exitIfNotLoadable() { - if (!Library.isLoadable ()) { + if (!Library.isLoadable (true)) { System.err.println("Libraries for platform " + Platform.PLATFORM + " cannot be loaded because of incompatible environment"); System.exit(1); } diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/Platform.java b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/Platform.java index 0d2b3d46dd6..939c4898686 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/Platform.java +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/Platform.java @@ -23,7 +23,7 @@ public static boolean isLoadable () { } public static void exitIfNotLoadable() { - if (!Library.isLoadable ()) { + if (!Library.isLoadable (true)) { System.err.println("Libraries for platform " + Platform.PLATFORM + " cannot be loaded because of incompatible environment"); System.exit(1); }