简体   繁体   English

在ARM上编译JInput

[英]Compile JInput on ARM

I have a Raspberry Pi 2, and an arduino pro micro set up as a Joystick. 我有一个Raspberry Pi 2和一个设置为操纵杆的arduino pro micro。 On the Pi i have a java application that runs well on a PC with both Linux and Windows with the arduino joystick connected. 在Pi上,我有一个Java应用程序,该应用程序在连接了arduino游戏杆的Linux和Windows电脑上都可以很好地运行。 But as soon as I start running the program on the pi I get an error message like: 但是,一旦我开始在pi上运行程序,我会收到一条错误消息,例如:

`Failed to load library:" /libjinput-linux64.so: /libjinput-linux64.so`

After some googling around i find that the problem is that the Jinput library is not compiled to run on ARM processors: 经过一番探索之后,我发现问题是Jinput库没有编译为可以在ARM处理器上运行:

JInput on RaspberryPi RaspberryPi上的JInput

So far so good, but this far I could not find a solution as to how I get the .so file compiled to run on the arm processor. 到目前为止,一切都很好,但是到目前为止,我没有找到关于如何编译.so文件以在arm处理器上运行的解决方案。 I guess it is somewhat trivial for someone with the knowledge, since the file is easily decompiled and the project is open source. 我想这对于有知识的人来说是微不足道的,因为文件很容易反编译并且项目是开源的。

But I have been stuck at this stage for the last 1½ month. 但是在过去的1.5个月中,我一直处于这一阶段。 Any help as to how to compile it where to find the files that are to be compiled and such, or alternatively finding an already compiled file for the raspberry pi 2 would be helpful. 关于如何编译它的任何帮助,在哪里可以找到要编译的文件等等,或者为raspberry pi 2找到已经编译的文件都将是有帮助的。

Not a direct answer about how to compile JNI libraries, but there appears to be a pre-compiled version available on Raspbian: 不是有关如何编译JNI库的直接答案,但是Raspbian上似乎有一个预编译的版本:

> apt search jinput
Sorting... Done
Full Text Search... Done
libjinput-java/stable 20100502+dfsg-7 all
  Java Game Controller API

libjinput-java-doc/stable 20100502+dfsg-7 all
  Java Game Controller API (javadoc)

libjinput-jni/stable 20100502+dfsg-7 armhf
  Java Game Controller API (jni)

So the solution may be to just apt install libjinput-java ; 因此,解决方案可能就是只apt install libjinput-java this will probably include the -jni package as a dependency ( see here ). 这可能包括-jni包作为依赖项( 请参阅此处 )。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM