public boolean isServerTerminated(){
  try {
    process.exitValue();
  }
 catch (  IllegalThreadStateException itse) {
    return false;
  }
  return true;
}

public boolean isServerTerminated ( ) { try { process . exitValue ( ) ; } catch ( IllegalThreadStateException itse ) { return false ; } return true ; }
checks whether server is still running
