kwhat / jnativehook

Global keyboard and mouse listeners for Java.
Other
1.73k stars 344 forks source link

crashing on macOS catalina #408

Open dipeshji opened 2 years ago

dipeshji commented 2 years ago

Using the jnativehook library, attached crash logs file crashLogs.txt .

KunMinX commented 2 years ago

me too, and has this problem solved ? .jar app not crash, but app installed by .pkg crash

kwhat commented 2 years ago

@KunMinX Please provide a crash log. I have been unable to reproducible the issue in this bug but it sounds like your experiencing a different problem.

kwhat commented 2 years ago

@dipeshji I have a pretty good idea where this crash came from, but I have no idea how to reproduce the problem. Please let me know if you can reliably trigger this error.

KunMinX commented 2 years ago

@kwhat

Strangely, even though I added a custom CrashHandler and packaged the program into pkg, after installation, it couldn't capture and output the crash log.

The clue to share here is that I packaged it via the javapackager command:

javapackager -deploy -native pkg -name [AppName] -BappVersion=1.0 -Bicon=AppIcon.icns -srcdir . -srcfiles [AppName].jar -appclass [MainPath] -outdir . -outfile [AppName]

Then after installation, there is no dynamic link library libJNativeHook.x86_64.dylib in the /Applications/[AppName].app/Contents/Java directory of the package,

I manually moved the dynamic link library in, this time the program does not crash and can run, but the function of the program is limited,

For example, it can listen for the command key, but not for letters and numbers, so I can't use it to listen for key combinations.