关于Raspberry Pi的JNativeHook

时间:2013-06-08 16:09:24

标签: java raspberry-pi debian-based

我试图在Raspberry Pi平台上使用JNativeHook

我有一个简单的java可执行文件,在Mac和Windows上运行良好,我认为应该可以在基于Debian的Linux发行版上正常工作....

然而,在启动时,我得到:

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

所以我必须做一些额外的工作才能在Linux上工作吗?

1 个答案:

答案 0 :(得分:0)

您需要将jar中包含的本机库重新编译为ARM。它应该在Linux上没有任何问题进行编译,使用ant compile jar来构建。如果您想file a bug报告,我将与您合作,以获得支持arm二进制文件。