Add new comment

Runtime.getRuntime().addShutdownHook() apparently not running

Running my project from a built as a runnable jar (no jar2exe), I see that the code in the shutdown hook thread runs properly, but if I build as an exe (using jar2exe), the code in the shutdown hook seems NOT to run. 

Should the code in the shutdownhook thread be running, or is this a limitation of a program packaged using jar2exe?

EDIT: I have discovered that sometimes programs built with jar2exe do indeed execute the shutdown hook code.  I will try to narrow the differences, perhaps flush the output to stdout will help determine if the code is running.