Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: small CS edit

...

Code Block
bgColor#ccccff
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(); }
  }
}

...