I have java application which shutdowns correctly when i use CTRL-C
, java application saves all data before shutdown. Now i trying to shutdown this java application from my C# console application using Process.Close()
, but application dont't save any data when i use this, i also tried Process.CloseMainWindow()
but using this nothing is happening, and also Process.Kill()
but using this process just killed, without any savining.
How can i raise shutdown hook on java application from C# console application?
A shutdown hook cannot be raised by another app.
The shutdown hook runs when:
System.exit()
is called, or
the last non-daemon thread exits.The shutdown hook will not run when: