Create an account

Very important

  • To access the important data of the forums, you must be active in each forum and especially in the leaks and database leaks section, send data and after sending the data and activity, data and important content will be opened and visible for you.
  • You will only see chat messages from people who are at or below your level.
  • More than 500,000 database leaks and millions of account leaks are waiting for you, so access and view with more activity.
  • Many important data are inactive and inaccessible for you, so open them with activity. (This will be done automatically)


Thread Rating:
  • 492 Vote(s) - 3.42 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to kill Java process and have a shutdown hook executed

#1
I have a Java application with a shutdown hook. The shutdown hook is executed when I run the application in IntelliJ and click on the **Exit** button (as opposed to the **Stop** button which does not result in the shutdown hook).

I need to be able to shutdown the process from a Windows batch file. I have tried various combinations of the `taskkill` command without luck (assuming a PID of 1234):

taskkill /pid 1234 /t
taskkill /pid 1234 /f /t

Is there a way for me to terminate a Java process from an MS batch file, **and have the Java shutdown hooks be executed**?

The application runs on a Windows server.
Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)

©0Day  2016 - 2023 | All Rights Reserved.  Made with    for the community. Connected through