output.setText("");
try { outputDocument.remove(0,outputDocument .getLength()); } catch(BadLocationException bl) { bl.printStackTrace(); }
	public void run(String command)	{		stop();		if(command.equalsIgnoreCase("clear"))		{			output.setText("");			return;		}		// Check for a URL		int colonIndex = command.indexOf(':');		int spaceIndex = command.indexOf(' ');		if(spaceIndex == -1)			spaceIndex = command.length();		if(colonIndex > 1 /* fails for C:\... */			&& colonIndex < spaceIndex)		{			jEdit.openFile(view,null,command,false,false);			return;		}		// It must be a command		if(appendEXE)		{			// append .exe to command name on Windows and OS/2			int dotIndex = command.indexOf('.');			if(dotIndex == -1 || dotIndex > spaceIndex)			{				command = command.substring(0,spaceIndex)					+ ".exe" + command.substring(spaceIndex);			}		}		// Expand variables		StringBuffer buf = new StringBuffer();		for(int i = 0; i < command.length(); i++)		{			char c = command.charAt(i);			switch(c)			{			case '%':				if(i == command.length() - 1)					buf.append(c);				else				{					Buffer buffer = view.getBuffer();					switch(command.charAt(++i))					{					case 'd':						buf.append(buffer.getFile().getParent());						break;					case 'j':						buf.append(jEdit.getJEditHome());						break;					case 'f':						buf.append(buffer.getPath());						break;					case '%':						buf.append('%');						break;					}				}				break;			default:				buf.append(c);			}		}		command = buf.toString();		appendText("\n> " + command,infoColor);		if(errors != null)		{			for(int i = 0; i < errors.size(); i++)			{				CompilerError error =					(CompilerError)errors.elementAt(i);				jEdit.removeEditorListener(error);			}			errors.removeAllElements();		}		try		{			process = Runtime.getRuntime().exec(command);			process.getOutputStream().close();		}		catch(IOException io)		{			appendText("\n",null);			String[] args = { io.getMessage() };			appendText(jEdit.getProperty("console.ioerror",args),				errorColor);			return;		}		stdin = new StdinThread();		stdout = new StdoutThread();		stderr = new StderrThread();	}