Process p = Runtime.getRuntime().exec(buf.toString()); BufferedReader err = new BufferedReader( new InputStreamReader(p.getErrorStream())); buf.setLength(0); String line; while((line = err.readLine()) != null) { buf.append(line); buf.append('\n'); } err.close(); if(buf.length() != 0) { Object[] args = { buf.toString() }; jEdit.error(view,"cmderr",args); return; }
String cmd = buf.toString(); Process proc = Runtime.getRuntime().exec(cmd); new CommandOutput(view,cmd,proc);
	public void actionPerformed(ActionEvent evt)	{		View view = getView(evt);		Buffer buffer = view.getBuffer();		String command = jEdit.input(view,"execute","execute.cmd");		if(command == null)			return;		StringBuffer buf = new StringBuffer();		for(int i = 0; i < command.length(); i++)		{			switch(command.charAt(i))			{			case '%':				if(i != command.length() - 1)				{					switch(command.charAt(++i))					{					case 'u':						buf.append(buffer.getPath());						break;					case 'p':						buf.append(buffer.getFile()							.getPath());						break;					default:						buf.append('%');						break;					}					break;				}			default:				buf.append(command.charAt(i));			}		}		try		{			Process p = Runtime.getRuntime().exec(buf.toString());			BufferedReader err = new BufferedReader(				new InputStreamReader(p.getErrorStream()));			buf.setLength(0);			String line;			while((line = err.readLine()) != null)			{				buf.append(line);				buf.append('\n');			}			err.close();			if(buf.length() != 0)			{				Object[] args = { buf.toString() };				jEdit.error(view,"cmderr",args);				return;			}		}		catch(IOException io)		{			Object[] error = { io.toString() };			jEdit.error(view,"ioerror",error);		}	}