简体   繁体   English

Raspberry Pi上的JNativeHook

[英]JNativeHook on Raspberry Pi

Am trying to use JNativeHook on the Raspberry Pi Platform 我正在尝试在Raspberry Pi平台上使用JNativeHook

I have a simple java executable that works great on Mac and Windows, and I presumed should work fine on a Debian-based linux distribution.... 我有一个简单的Java可执行文件,在Mac和Windows上都可以正常运行,并且我认为在基于Debian的linux发行版上应该可以正常工作。

However on-startup I get: 但是在启动时我得到:

Exception in thread "AWT-EventQueue-0" java.lang.ExceptionInInitializerError
at Main.<init>(Main.java:159)
at Main$1.run(Main.java:129)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:251)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:721)
at java.awt.EventQueue.access$200(EventQueue.java:103)
at java.awt.EventQueue$3.run(EventQueue.java:682)
at java.awt.EventQueue$3.run(EventQueue.java:680)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:691)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:244)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:163)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:151)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:147)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:139)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:97)
Caused by: java.lang.RuntimeException: Unable to locate the native library.
at org.jnativehook.GlobalScreen.loadNativeLibrary(Unknown Source)
at org.jnativehook.GlobalScreen.<init>(Unknown Source)
at org.jnativehook.GlobalScreen.<clinit>(Unknown Source)
... 16 more

So I have to do something extra for this to work on Linux? 因此,我必须做一些额外的工作才能在Linux上工作?

You need to recompile the native library contained in the jar to ARM. 您需要将jar中包含的本机库重新编译为ARM。 It should compile without any issues on Linux, use ant compile jar to build. 它应该在Linux上没有任何问题地进行ant compile jar ,请使用ant compile jar进行构建。 If you want to file a bug report I will work with you to get an arm binary supported. 如果您要提交错误报告,我将与您合作以获取支持的二进制文件。

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

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