diff options
-rw-r--r-- | src/org/jdesktop/applet/util/JNLPAppletLauncher.java | 14 | ||||
-rw-r--r-- | www/index.html | 10 |
2 files changed, 20 insertions, 4 deletions
diff --git a/src/org/jdesktop/applet/util/JNLPAppletLauncher.java b/src/org/jdesktop/applet/util/JNLPAppletLauncher.java index 956e148..d48292b 100644 --- a/src/org/jdesktop/applet/util/JNLPAppletLauncher.java +++ b/src/org/jdesktop/applet/util/JNLPAppletLauncher.java @@ -37,8 +37,8 @@ * intended for use in the design, construction, operation or * maintenance of any nuclear facility. * - * $Revision: 1.23 $ - * $Date: 2007/08/15 22:39:31 $ + * $Revision: 1.24 $ + * $Date: 2007/10/09 18:17:16 $ * $State: Exp $ */ @@ -595,6 +595,7 @@ import org.xml.sax.helpers.DefaultHandler; * boolean usingJNLPAppletLauncher = * Boolean.valueOf(sunAppletLauncher).booleanValue(); * + * boolean loaded = false; * if (usingJNLPAppletLauncher) { * try { * Class jnlpAppletLauncherClass = @@ -603,6 +604,11 @@ import org.xml.sax.helpers.DefaultHandler; * jnlpAppletLauncherClass.getDeclaredMethod("loadLibrary", * new Class[] { String.class }); * jnlpLoadLibraryMethod.invoke(null, new Object[] { libraryName }); + * loaded = true; + * } catch (ClassNotFoundException ex) { + * System.err.println("loadLibrary(" + libName + ")"); + * System.err.println(ex); + * System.err.println("Attempting to use System.loadLibrary instead"); * } catch (Exception e) { * Throwable t = e; * if (t instanceof InvocationTargetException) { @@ -616,7 +622,9 @@ import org.xml.sax.helpers.DefaultHandler; * // Throw UnsatisfiedLinkError for best compatibility with System.loadLibrary() * throw (UnsatisfiedLinkError) new UnsatisfiedLinkError().initCause(e); * } - * } else { + * } + * + * if (!loaded) { * System.loadLibrary(libraryName); * } * } diff --git a/www/index.html b/www/index.html index dd0f70c..b4d2265 100644 --- a/www/index.html +++ b/www/index.html @@ -518,6 +518,7 @@ boolean usingJNLPAppletLauncher = Boolean.valueOf(sunAppletLauncher).booleanValue(); + boolean loaded = false; if (usingJNLPAppletLauncher) { try { Class jnlpAppletLauncherClass = @@ -526,6 +527,11 @@ jnlpAppletLauncherClass.getDeclaredMethod("loadLibrary", new Class[] { String.class }); jnlpLoadLibraryMethod.invoke(null, new Object[] { libraryName }); + loaded = true; + } catch (ClassNotFoundException ex) { + System.err.println("loadLibrary(" + libName + ")"); + System.err.println(ex); + System.err.println("Attempting to use System.loadLibrary instead"); } catch (Exception e) { Throwable t = e; if (t instanceof InvocationTargetException) { @@ -539,7 +545,9 @@ // Throw UnsatisfiedLinkError for best compatibility with System.loadLibrary() throw (UnsatisfiedLinkError) new UnsatisfiedLinkError().initCause(e); } - } else { + } + + if (!loaded) { System.loadLibrary(libraryName); } } |