0

Currently, I make a simple clicker in java. I liked the library jnativehook, because it's working in the background and I added it as a dependency

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

Compilation ended successfully and IDE had no warning but after running JAR with terminal

java -jar clicker.jar

I had the following error

C:\Users\szymo\IdeaProjects\java gui\target>java -jar clicker-javagui-1.0-SNAPSHOT.jar`

Error: Unable to initialize main class Main

Caused by: java.lang.NoClassDefFoundError: org/jnativehook/NativeHookException

I suspect that it's a problem with compiling the library to jar. I tried also adding jnativehook.jar to classpath but it didn't help.

I use JDK 11, and Maven 3.6.3.

SilverNak
  • 3,283
  • 4
  • 28
  • 44
simoneQ
  • 1
  • 5

0 Answers0