1

我在 ubuntu 12.04LTS 下使用游戏手柄控制器、thrustmaster firestorm 双模拟 3 (usb) 的 java 项目遇到了一些问题。我知道控制器在 ubuntu 下工作,因为我可以校准和测试它。问题在于运行 jar,因为我收到以下错误:

un 04, 2013 9:39:42 AM net.java.games.input.ControllerEnvironment log
INFO: Failed to load library: no jinput-linux in java.library.path

java.lang.UnsatisfiedLinkError: no jinput-linux in java.library.path
    at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1856)
    at java.lang.Runtime.loadLibrary0(Runtime.java:845)
    at java.lang.System.loadLibrary(System.java:1084)
    at net.java.games.input.LinuxEnvironmentPlugin$1.run(LinuxEnvironmentPlugin.java:69)
    at java.security.AccessController.doPrivileged(Native Method)
    at net.java.games.input.LinuxEnvironmentPlugin.loadLibrary(LinuxEnvironmentPlugin.java:61)
    at net.java.games.input.LinuxEnvironmentPlugin.<clinit>(LinuxEnvironmentPlugin.java:102)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:188)
    at net.java.games.input.DefaultControllerEnvironment.getControllers(DefaultControllerEnvironment.java:159)
    at com.codeminders.ardrone.controllers.ThrustmasterController.initGamepad(ThrustmasterController.java:88)
    at com.codeminders.ardrone.controllers.ThrustmasterController.getGamepad(ThrustmasterController.java:79)
    at com.codeminders.controltower.ControlTower.initController(ControlTower.java:114)
    at com.codeminders.controltower.ControlTower.<init>(ControlTower.java:90)
    at com.codeminders.controltower.ControlTower.main(ControlTower.java:591)
Jun 04, 2013 9:39:42 AM net.java.games.input.ControllerEnvironment log
INFO: net.java.games.input.LinuxEnvironmentPlugin is not supported

No gamepad found!
No suitable controller found! Control disabled
Connecting to the drone
Using command port: 1500

我已经使用 IDEA 创建了 .jar 工件,并且我认为我已经在 .jar 中包含了所有库,但即便如此,我还是得到了那个错误。我也尝试过像这样执行我的 .jar

java -jar javadrone2.jar -Djava.library.path=/usr/li/libjinput.so

但是输出相同...我相信我已经安装了 jinput 库,因为如果我输入

:$ locate jni
...
/usr/lib/jni
/usr/lib/i386-linux-gnu/jni
/usr/lib/i386-linux-gnu/jni/libatk-wrapper.so
/usr/lib/i386-linux-gnu/jni/libatk-wrapper.so.0
/usr/lib/i386-linux-gnu/jni/libatk-wrapper.so.0.0.18
/usr/lib/i386-linux-gnu/jni/libgnomeproxy-1.0.0.so
/usr/lib/i386-linux-gnu/jni/libpty.so
/usr/lib/i386-linux-gnu/jni/libspawner.so
/usr/lib/jni/libjinput.so
/usr/lib/jni/liblwjgl.so
/usr/lib/jni/libswt-atk-gtk-3833.so
...

:$locate jniput 
...
/usr/lib/jni/libjinput.so
/usr/share/java/jinput.jar
...

我可以做些什么来运行我的 .jar?

4

0 回答 0