Hi all
i m trying to write a java program to open an application on a mac, wait in the background until the user closes the application, then the java program performs another task. is there a way to know when the user has closed the application started by java?
thanks
Sure, here’s how:
ProcessBuilderorRuntime.execto get hold of aProcess.process.start().proccess.waitFor()to block until the external program terminates.This should work fine on Mac and Windows systems.
Example: