static void forceKill(String commandUID){
  if (!ExecutorUtils.isUnixOS())   return;
  AsyncCommandResult killRes=null;
  try {
    File binDir=new File("/bin");
    if (!binDir.exists())     return;
    final String pkillScript=binDir.getPath() + File.separator + ExecutorContstants.KILL_TEST_SCRIPT;
    SimpleCommand killCmd=new SimpleCommand("Kill JVM",pkillScript,commandUID);
    killRes=Executor.executeAsync(killCmd,null);
    killRes.waitFor(5 * 1000);
  }
 catch (  InterruptedException e) {
  }
 finally {
    if (killRes != null)     killRes.stop(false);
  }
}

static void forceKill ( String commandUID ) { if ( ! ExecutorUtils . isUnixOS ( ) ) return ; AsyncCommandResult killRes = null ; try { File binDir = new File ( "/bin" ) ; if ( ! binDir . exists ( ) ) return ; final String pkillScript = binDir . getPath ( ) + File . separator + ExecutorContstants . KILL_TEST_SCRIPT ; SimpleCommand killCmd = new SimpleCommand ( "Kill JVM" , pkillScript , commandUID ) ; killRes = Executor . executeAsync ( killCmd , null ) ; killRes . waitFor ( 5 * 1000 ) ; } catch ( InterruptedException e ) { } finally { if ( killRes != null ) killRes . stop ( false ) ; } }
kill javacommand by kill - 9 with javacommand uid note : this method only relevant for unix based machines .
