For a Java Process, I see a method to get the exit code, but how do I know when the process exited?
I'd like to fire an event when my Process is finished running...
Process.waitFor()
If you want to fire an event without stopping your current thread, start a thread that launches the process, calls waitFor(), and then fires the event when the time is right.
Thread.start(new Runnable() {
public void main() {
Process p = startProcess()
p.waitFor()
fireEvent()
}
})
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With