m_RunThread = new ClassRunner(theClass, commandArgs);
Vector argv = new Vector(); for (int i = 2; i < commandArgs.length; i++) argv.add(commandArgs[i]);  m_RunThread = new ClassRunner(theClass, (String[]) argv.toArray(new String[argv.size()]));
  public void runCommand(String commands) throws Exception {    System.out.println("> " + commands + '\n');    System.out.flush();    String [] commandArgs = splitOptions(commands);    if (commandArgs.length == 0) {      return;    }    if (commandArgs[0].equals("java")) {      // Execute the main method of a class      commandArgs[0] = "";      try {	if (commandArgs.length == 1) {	  throw new Exception("No class name given");	}	String className = commandArgs[1];	commandArgs[1] = "";	if (m_RunThread != null) {	  throw new Exception("An object is already running, use \"break\""			      + " to interrupt it.");	}	Class theClass = Class.forName(className);	m_RunThread = new ClassRunner(theClass, commandArgs);	m_RunThread.setPriority(Thread.MIN_PRIORITY); // UI has most priority	m_RunThread.start();	      } catch (Exception ex) {	System.err.println(ex.getMessage());      }    } else if (commandArgs[0].equals("cls")) {      // Clear the text area      m_OutputArea.setText("");    } else if (commandArgs[0].equals("break")) {      if (m_RunThread == null) {	System.err.println("Nothing is currently running.");      } else {	System.out.println("[Interrupt...]");	m_RunThread.interrupt();      }    } else if (commandArgs[0].equals("kill")) {      if (m_RunThread == null) {	System.err.println("Nothing is currently running.");      } else {	System.out.println("[Kill...]");	m_RunThread.stop();	m_RunThread = null;      }    } else if (commandArgs[0].equals("exit")) {      // Shut down      // fire the frame close event      processEvent(new WindowEvent(this, WindowEvent.WINDOW_CLOSING));          } else {      boolean help = ((commandArgs.length > 1)		      && commandArgs[0].equals("help"));      if (help && commandArgs[1].equals("java")) {	System.err.println("java <classname> <args>\n\n"			   + "Starts the main method of <classname> with "			   + "the supplied command line arguments (if any).\n"			   + "The command is started in a separate thread, "			   + "and may be interrupted with the \"break\"\n"			   + "command (friendly), or killed with the \"kill\" "			   + "command (unfriendly).\n");      } else if (help && commandArgs[1].equals("break")) {	System.err.println("break\n\n"			   + "Attempts to nicely interrupt the running job, "			   + "if any. If this doesn't respond in an\n"			   + "acceptable time, use \"kill\".\n");      } else if (help && commandArgs[1].equals("kill")) {	System.err.println("kill\n\n"			   + "Kills the running job, if any. You should only "			   + "use this if the job doesn't respond to\n"			   + "\"break\".\n");      } else if (help && commandArgs[1].equals("cls")) {	System.err.println("cls\n\n"			   + "Clears the output area.\n");      } else if (help && commandArgs[1].equals("exit")) {	System.err.println("exit\n\n"			   + "Exits the SimpleCLI program.\n");      } else {	// Print a help message	System.err.println("Command must be one of:\n"			   + "\tjava <classname> <args>\n"			   + "\tbreak\n"			   + "\tkill\n"			   + "\tcls\n"			   + "\texit\n"			   + "\thelp <command>\n");      }    }  }