I am trying to get JInput working on a raspeberryPi. I know it is not ideal to use JInput without an ide, but the Raspberry Pi is too slow to work with most of them. I have managed to sucessfully compile and run my program from the command line on windows. However, on the pi i am having trouble. The pi is running raspbian, java version 1.7.0_40 with hotspot client vm build 24.0-b56. I have set up the file structure as so:
lib/dist
-jinput-test.jar
-jinput.jar
-Controller
--.dll, .so files
--LinuxEnvironmentPlugin.java
bin
src
I am using the command
java -Djava.library.path=lib/dist/Controller -Djinput.plugins=net.java.games.input.LinuxEnvironmentPlugin -cp bin:lib/dist/jinput.jar:lib/dist/Controller Main
to try and run.
However, i get
"INFO: Failed to load library:" /libjinput-linux64.so: /libjinput-linux64.so: wrong ELF class: ELFCLASSS64"
This is where I am confused. Why is it trying to use the 64 bit file. The rasperry Pi has a ARM version 6 processor, which only works with 32 bit. So why is it looking for the 64 bit file in the first place? I have also tried running with the -d32 option but that doesn't help.
You need a native shared library (JNI) built for the Pi (ARM). Fortunately, there are pre-built raspbian packages for JInput that include the required native library:
You should also add uinput to the end of /etc/modules so the controller gets detected. If you want a nice GUI to test the controller try also installing: