Jinput with 32bit

As many of you probably know, I’m in the process of building an arcade cabinet to house the games I make. I am on the last step of this project, which is making the raspberry pi 3 run my game. The game runs fine, but I have run into a problem with the controllers/joystick and Jinput (I believe). Now please keep in mind, I’m not the best or smartest at setting up stuff under the hood. Everything works fine in windows, but on the pi, I get:

java.lang.UnsatisfiedLinkError tmp/natives-114326371/libjinput-linux.so wrong ELF file

From my research, I think this is happening because the jinput linux file is at 64 bit, but the JVM is 32 bit. Also from my research, it looks like you can’t use a 64 bit JVM with the raspberry pi 3. So my question is, what do I do? Jinput is only 64 bit right? Or can someone point me in the direction to get the 32 bit version? Or is there something I’m completely missing while I build the game?

Edit: to say here’s how I build the game: Export the project from Eclipse, then use jar splice to put the game and all the dependencies together, which include all of the windows, mac and linux files.

I’m going to try right now just not putting the 64 bit file in the build path and see if that works.

Are you sure it’s not that the jinput library you’ve got there is compiled for x86 rather than ARM?

Cas :slight_smile:

No I am not sure. I assume it is…but I’m also not sure how to get the library compiled for arm. Time to google.

Ok, I got the Pi to pick up the controllers. Now for some reason it’s throwing and index out of bounds exception while looking for the buttons. That shouldn’t be too hard to figure out.

How did you get it to work so far?

Cas :slight_smile:

I think I’m just checking for too many buttons or something. Since both the arcade controls and one of my controllers get picked up as ‘joysticks’, I simply put a boolean flag in the beginning of the class: isArcade. The arcade controls only have 6 buttons so I most likely just didn’t remove the checks for the additional buttons that the regular controller contains. I’ll probably end up posting some pictures or a video tonight, because there is only 2 more steps until it’s completed, which are this button situation and a LineUnavailableException that gets thrown when playing audio.

P.S if anyone is wondering how I got the controls to work in the first place with the PI, I had to go to github and download the correctly compiled linux.so file.

Well I figured out the button problem. It was because my Jinput build was only searching for buttons which were actually named ‘BUTTON’, which worked fine on Windows. On the PI, all the buttons are named something different, such as ‘Trigger’, ‘Trigger 2’, ‘Base’, ‘Base 2’, and ‘Pinkie’. So now that that problem is out of the way, I just need to figure out the LineUnavailableException for the sound and then the cabinet is done! I’m excited to show you guys pictures/videos of it in action.

I see in my future another release with arm support…