Java tutorial
//package com.java2s; public class Main { private static boolean waitForProcess(Process p) { boolean isSuccess = false; int returnCode; try { returnCode = p.waitFor(); switch (returnCode) { case 0: isSuccess = true; break; case 1: break; default: break; } } catch (InterruptedException e) { e.printStackTrace(); } return isSuccess; } }