waitForExit

public abstract int waitForExit()

Blocks until the process terminates and returns its exit value.

Return

the process exit code (or implementation-defined value if destroyed)

Throws

if the process was never started or start failed

if interrupted while waiting