I know I'm moaning, but it looks like an error to users.
You're right, the exception happens in a PrivilegedAction so it can't be caught. Could use something like this in Input.java right before the call to "Controllers.create();"...
Code:
class LoadLibAction implements PrivilegedAction {
boolean failed;
public final Object run () {
try {
String lib_path = System.getProperty("net.java.games.input.librarypath");
if (lib_path != null)
System.load(lib_path + File.separator + System.mapLibraryName("jinput-dx8"));
else
System.loadLibrary("jinput-dx8");
} catch (UnsatisfiedLinkError e) {
failed = true;
}
return null;
}
}
LoadLibAction action = new LoadLibAction();
AccessController.doPrivileged(action);
if (action.failed) {
Log.info("Found 0 controllers (jinput not available)");
return;
}
Maybe a simpler workaround would be a setting in Slick that turns off the controller support, so Slick will never try to call into the jinput stuff? With brief testing this seems to work...
Code:
/**
* Disables support for controllers. This means the jinput JAR and native libs are not required.
*/
static public void disableControllers () {
controllersInited = true;
}