De_Cisse
asked on
Stop execution of jar
Is it possible to stop the execution of a .jar file using e.g. a .bat-file? If so, how can this be done?
If not, what is the appropriate way to stop the execution? I could use system.exit(), but how can I call this from an external procedure or pass arguments to a running java application?
If not, what is the appropriate way to stop the execution? I could use system.exit(), but how can I call this from an external procedure or pass arguments to a running java application?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
taskkill /F /IM java.exe will kill any JVM. You cannot be sure that you won't kill another application in addition to yours.
That is true, the solution using taskkill arbitrarily kills all Java VMs. This could create problems if you are also running java based programs such as Netbeans. For this reason this is not an elegant but a easy solution.
ASKER
Superb way to control start and stop of an application. You can write a generic ClientApplication to stop whatever jar you want.
Open in new window