In fact the JVM was complaining that the library path was relative, not absolute. The error is in the findLibrary method of PluginLoader : instead of
1
| String libpath = parentDir.getPath() + File.separator + System.mapLibraryName(libname); |
it should be something like :
1
| String libpath = parentDir.getAbsolutePath() + File.separator + System.mapLibraryName(libname); |
Well there are several other changes involved to support correctly absolute paths, I'll post the code here so that it can be tested before submitting an official RFE + patch

All these changes are made in net.java.games.input.DefaultControllerEnvironment.
1) replace method scanControllers() with
1 2 3 4 5 6 7 8 9 10 11 12
| private void scanControllers() { String pluginPathName = System.getProperty("jinput.controllerPluginPath"); if(pluginPathName == null) { pluginPathName = "controller"; }
File[] dirs = getPotentialDirectories(pluginPathName);
for(int i = 0; i < dirs.length; i++) { scanControllersAt(dirs[i]); } } |
2) replace method scanControllersAt(String path) with
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
| private void scanControllersAt(File file) { try { Plugins plugins = new Plugins(file); Class[] envClasses = plugins.getExtends(ControllerEnvironment.class); for(int i=0;i<envClasses.length;i++){ try { if (DEBUG) { System.out.println("ControllerEnvironment "+ envClasses[i].getName() +" loaded by "+envClasses[i].getClassLoader()); } ControllerEnvironment ce = (ControllerEnvironment) envClasses[i].newInstance(); addControllers(ce.getControllers()); } catch (Exception e) { e.printStackTrace(); } } } catch (Exception e) { e.printStackTrace(); } } |
(this is exactly the same method, except that it handles directly Files)
3) add the following methods
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52
| private String[] getPotentialPaths(String pluginPathName) { String javaHomePath = System.getProperty("java.home") + File.separator + "lib" + File.separator + pluginPathName; String userDirPath = System.getProperty("user.dir") + File.separator + pluginPathName; String rawPath = pluginPathName;
String[] allPaths = { javaHomePath, userDirPath, rawPath };
return allPaths; }
private File[] getPotentialDirectories(String pluginPathName) { String[] paths = getPotentialPaths(pluginPathName); File[] dirs = null;
if(paths.length > 0) { File[] allDirs = new File[paths.length]; int validDirCount = 0;
for(int i = 0; i < paths.length; i++) { try { File f = (new File(paths[i])).getCanonicalFile();
if(f.exists()) { boolean duplicated = false;
for(int j = 0; j < validDirCount; j++) { duplicated |= f.equals(allDirs[j]); }
if(! duplicated) { allDirs[validDirCount] = f; validDirCount ++; } } }
catch(IOException ioe) { ioe.printStackTrace(); } }
dirs = new File[validDirCount]; System.arraycopy(allDirs, 0, dirs, 0, validDirCount); }
else { dirs = new File[0]; }
return dirs; } |
getPotentialPaths constructs the paths to be explored.
getPotentialDirectories makes sure that no directory will be searched twice by comparing files (trying to load the same library several times generates errors).
[EDIT] Sorry, my code indentation got screwed up by this damn forum

If you are interested, I can mail you the file.