0

This is only Windows specific, since in Unix system this works properly.

I have a java cli application (its actually a service written using spring-boot) that runs in the console (cmd).

When pressing ctrl+c in console the application gets killed on windows in a way that java virtual machine itself still remains in memory but the service is killed. This is very annoying since some of the resources still remains locked.

On uinux systems this works by generating an SIGINT and service has the possibility of graceful stop and jvm also exit properly.

Any workarounds?

  • Maybe you could try to register a shutdown hook, and do a proper `System.exit` : http://stackoverflow.com/questions/1611931/catching-ctrlc-in-java – Arnaud Dec 09 '16 at 14:51
  • I will try but I already suspect that this will not work, as I said in Unix the shutdown procedure is called (spring-boot default shutdown actually) but in Windows nothing gets called. – Corneliu Maftuleac Dec 12 '16 at 15:08

0 Answers0