...
Code Block | ||
---|---|---|
| ||
import java.io.InputStream; import java.io.InputStreamReader; import java.io.BufferedReader; public class Exec { public static void main(String args[]) { try { Runtime rt = Runtime.getRuntime(); Process proc = rt.exec("notemaker"); InputStream stderris = proc.getErrorStreamgetInputStream(); InputStreamReader isr = new InputStreamReader(stderris); BufferedReader br = new BufferedReader(isr); String line; while ( (line = br.readLine()) != null) System.out.println(line); //prints the error lines int exitVal = proc.waitFor(); } catch (Throwable t) { t.printStackTrace(); } } } |
...