Okay, I really don't want to put the binaries in the system folder, it will make it too complicated for people to understand

I don't want to make a batch file to set the library path either

well, is there a way to just load it from say, System.getProperty("user.dir") + "/jinput"?
I currently got this code but keeps giving me an UnsatisfiedLinkError.
1 2 3 4 5 6 7 8 9 10 11
| public class ControllerTest { public static void main(String args[]) { System.setProperty("java.library.path", System.getProperty("user.dir") + System.getProperty("file.separator") + "bin"); System.loadLibrary("jinput-dx8.dll"); System.loadLibrary("jinput-raw.dll"); Controller[] ca = ControllerEnvironment.getDefaultEnvironment().getControllers(); for(int i = 0; i < ca.length; i++) { System.out.println("Found input device: " + ca[i].getName()); } } } |
Error:
1 2 3 4 5 6 7 8 9 10 11
| init: deps-jar: compile-single: run-single: Exception in thread "main" java.lang.UnsatisfiedLinkError: no jinput-dx8.dll in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1682) at java.lang.Runtime.loadLibrary0(Runtime.java:823) at java.lang.System.loadLibrary(System.java:1030) at renoria.handler.ControllerTest.main(ControllerTest.java:24) Java Result: 1 BUILD SUCCESSFUL (total time: 0 seconds) |
Solution please? thanks in advance.