waitForExit

public int waitForExit()

Waits for the process to terminate.

Returns immediately if the process is already stopped (either because destroy() was already explicitly called, or it terminated by itself).

Return

exit value (or EXIT_VALUE_DESTROYED if destroy was used)

Throws

if start was never even called or the process was attempted to be started but that start failed (unknown executable, underlying OS error, etc.)

if interrupted while waiting