Skip to content
Steven Jenkins De Haro edited this page Jul 5, 2022 · 3 revisions

What does this tool do?

Answer

Caffeinate is a simple tool that prevents a computer from entering lock mode while preventing communication apps from switching to the inactive status. It accomplishes this by controlling the mouse pointer on the computer in a way that can't be noticed by the user.

What programming language does this use?

Answer

The library was built using Java 11x on Temurin OpenJDK (was AdoptOpenJDK) in Netbeans 13x using Maven 3.8.4.

How to fix common errors in Linux?

Answer

Error: Exception in thread "main" java.lang.UnsatisfiedLinkError: Can't load library: /usr/lib/jvm/java-11-openjdk-amd64/lib/libawt_xawt.so

Fix:

sudo apt install openjdk-11-jdk -y

Test:

ldd /usr/lib/jvm/java-11-openjdk-amd64/lib/libawt_xawt.so

Error: Exception in thread "main" java.lang.UnsatisfiedLinkError: /mnt/c/test/libJNativeHook.x86_64.so: libxkbcommon-x11.so.0: cannot open shared object file: No such file or directory

Fix:

sudo apt-get install libxkbcommon-x11-0 -y

Error: SEVERE: load_input_helper [1827]: XkbGetKeyboard failed to locate a valid keyboard!

Workaround for when you are ready to exit (WSL):

ps -aux
kill <PID>

Why is the unpacked library not automatically cleaned up?

Answer

This is a known issue that affects Windows, for example, kwhat/jnativehook#268, but it could be affecting other operating systems. There is code in place to clean up the library if exited properly using the hotkeys, but if the file is still in use by the JVM, then it won't be deleted. In either case, it is fine to leave the file if you plan on running the application again.