diff options
author | endolf <[email protected]> | 2009-03-28 16:36:03 +0000 |
---|---|---|
committer | endolf <[email protected]> | 2009-03-28 16:36:03 +0000 |
commit | bac3720d546ff5890bab19484583e7e409c6df83 (patch) | |
tree | eefd2d8078df7a14df1d8926c81cd5919cbb0fa6 /plugins/linux | |
parent | a7c1b60a880ea1ff1480f16452e87044e30e98ae (diff) |
Check the arch type before loading the native library
git-svn-id: file:///home/sven/projects/JOGL/git-svn/svn-server-sync/jinput/trunk@222 e343933a-64c8-49c5-92b1-88f2ce3e89e8
Diffstat (limited to 'plugins/linux')
-rw-r--r-- | plugins/linux/src/java/net/java/games/input/LinuxEnvironmentPlugin.java | 30 |
1 files changed, 15 insertions, 15 deletions
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 37fc7d9..309ccab 100644 --- a/plugins/linux/src/java/net/java/games/input/LinuxEnvironmentPlugin.java +++ b/plugins/linux/src/java/net/java/games/input/LinuxEnvironmentPlugin.java @@ -59,10 +59,16 @@ public final class LinuxEnvironmentPlugin extends ControllerEnvironment implemen 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 { + if (lib_path != null) + System.load(lib_path + File.separator + System.mapLibraryName(lib_name)); + else + System.loadLibrary(lib_name); + } catch (UnsatisfiedLinkError e) { + logln("Failed to load library: " + e.getMessage()); + e.printStackTrace(); + supported = false; + } return null; } }); @@ -88,17 +94,11 @@ public final class LinuxEnvironmentPlugin extends ControllerEnvironment implemen static { String osName = getPrivilegedProperty("os.name", "").trim(); if(osName.equals("Linux")) { - try { - if("i386".equals(getPrivilegedProperty("os.arch"))) { - loadLibrary(LIBNAME); - } else { - loadLibrary(LIBNAME + POSTFIX64BIT); - } - supported = true; - } catch (UnsatisfiedLinkError e) { - logln("Failed to load library: " + e.getMessage()); - e.printStackTrace(); - supported = false; + supported = true; + if("i386".equals(getPrivilegedProperty("os.arch"))) { + loadLibrary(LIBNAME); + } else { + loadLibrary(LIBNAME + POSTFIX64BIT); } } } |