From my "quick" testing, no. @Deastrum's linked solution works under Windows when using CTRL-C to interrupt the program in a DOS command line session. I've not been able to use the solution to detect shutdowns via Task Manager, user logout, or system shutdowns. It does seem to work fairly well under Linux using the standard kill command, stopping it under systemd and shutting down/restarting Linux (tested on Ubuntu Server 18.04LTS). Note: The kill command can be used with various options that can be used to stop the .jar file without evoking the shutdown hook (and may be configured in such a way on other distributions).