How to install JNativeHook Library?

时光总嘲笑我的痴心妄想 提交于 2020-01-24 04:21:30

问题


I am trying to use the JNativeHook library to provide global keyboard and mouse listeners for my Java application. I downloaded the source files from here but I am not sure how to install it to eclipse and make a use of it. I have also looked at the Compiling Instructions. I followed all the steps, but it seems to be confusing for me.

Can anyone guide me on how to use the JNativeHook Library? I am using Eclipse as IDE and windows 7 as an operating system.


回答1:


Follow below steps to install JNativeHook in Eclipse:

  1. Goto release, download and unzip JNativeHook-2.0.0.zip, then get the JNativeHook.jar in the JNativeHook/jar folder.
  2. In Eclipse, Right click on project > properties > Java Build Path > Libraries > Add JARs
  3. Finally, add JNativeHook.jar

If you want to install with maven locally you can also proceed with these instruction.




回答2:


maven dependencies are provided so just add the following dependency to your pom.xml:

<dependency>
    <groupId>com.1stleg</groupId>
    <artifactId>jnativehook</artifactId>
    <version>LATEST</version>
</dependency>


来源:https://stackoverflow.com/questions/28393628/how-to-install-jnativehook-library

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!