code: public static void killProcessByPid( Session session, int pid ) throws Exception {
          String command = "kill -9 " + pid;
          String remoteResponseStr = launchACommand(session, command);
          if (remoteResponseStr.length() == 0) {
              return;
          } else {
              new Exception(remoteResponseStr);
          }
  
      }
docs: Kills a process using its pid.
  
  <P><b>THIS WORKS ONLY ON LINUX HOSTS</b></p>
  
  @param session the session to use.
  @param pid the pid to use.
  @throws Exception