NoClassDefFoundError after importing library

151 Views Asked by At

I have made a small program that simulates mouse movements. Everything has worked as supposed to so far till i added the jnativehook library for listening to keyboard input to stop the program.

After this the problems started to occur, when i launch my program from the IDE (im using intelij) everything works. But when i build the program into a jar the jar wont launch giving this error: error code

i have tried to add the path like this java -classpath .;jnativehook-2.1.0.jar Main (found this methode here but it doesn't work) also placed the nativehook.jar in my dir but this also didn't help. My project structure looks like this atm: project settings

I'm new to adding library's to projects, can anyone help me solve this problem ?

1

There are 1 best solutions below

0
On

Hey thanks all for your answers, @tevemadar I was able to figure it out with the help from your link of the intelij website. Much appreciated i been trying to get it to work for 4-5.