diff options
author | endolf <[email protected]> | 2007-09-23 02:01:26 +0000 |
---|---|---|
committer | endolf <[email protected]> | 2007-09-23 02:01:26 +0000 |
commit | f6a6be5b1c9ea7beadecb89eb9dc017f8ca736b9 (patch) | |
tree | 4b7e0c7ad885e596df5dc165bb822a692c1522e0 | |
parent | 3bd41b2cac897ea842291e0b792c9f0124b857a6 (diff) |
Rather than crashing, just disable the plugin if we an't load the dll
git-svn-id: file:///home/sven/projects/JOGL/git-svn/svn-server-sync/jinput/trunk@207 e343933a-64c8-49c5-92b1-88f2ce3e89e8
-rwxr-xr-x | plugins/OSX/src/java/net/java/games/input/OSXEnvironmentPlugin.java | 15 | ||||
-rw-r--r-- | plugins/linux/src/java/net/java/games/input/LinuxEnvironmentPlugin.java | 7 |
2 files changed, 14 insertions, 8 deletions
diff --git a/plugins/OSX/src/java/net/java/games/input/OSXEnvironmentPlugin.java b/plugins/OSX/src/java/net/java/games/input/OSXEnvironmentPlugin.java index cc9289b..c900279 100755 --- a/plugins/OSX/src/java/net/java/games/input/OSXEnvironmentPlugin.java +++ b/plugins/OSX/src/java/net/java/games/input/OSXEnvironmentPlugin.java @@ -70,11 +70,16 @@ public final class OSXEnvironmentPlugin extends ControllerEnvironment implements AccessController.doPrivileged( new PrivilegedAction() { public final Object run() { - String lib_path = System.getProperty("net.java.games.input.librarypath"); - if (lib_path != null) - System.load(lib_path + File.separator + System.mapLibraryName(lib_name)); - else - System.loadLibrary(lib_name); + try { + String lib_path = System.getProperty("net.java.games.input.librarypath"); + if (lib_path != null) + System.load(lib_path + File.separator + System.mapLibraryName(lib_name)); + else + System.loadLibrary(lib_name); + } catch (UnsatisfiedLinkError e) { + e.printStackTrace(); + supported = false; + } return null; } }); diff --git a/plugins/linux/src/java/net/java/games/input/LinuxEnvironmentPlugin.java b/plugins/linux/src/java/net/java/games/input/LinuxEnvironmentPlugin.java index a2d1c8d..b8e9ef6 100644 --- a/plugins/linux/src/java/net/java/games/input/LinuxEnvironmentPlugin.java +++ b/plugins/linux/src/java/net/java/games/input/LinuxEnvironmentPlugin.java @@ -88,16 +88,17 @@ public final class LinuxEnvironmentPlugin extends ControllerEnvironment implemen static { String osName = getPrivilegedProperty("os.name", "").trim(); if(osName.equals("Linux")) { - supported = true; try { loadLibrary(LIBNAME); + supported = true; } catch (UnsatisfiedLinkError e) { try { loadLibrary(LIBNAME + POSTFIX64BIT); + supported = true; } catch (UnsatisfiedLinkError e2) { logln("Failed to load 64 bit library: " + e2.getMessage()); - // throw original error - throw e; + e.printStackTrace(); + supported = false; } } } |