Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4062587

exec Processes failing with long output.

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Won't Fix
    • Icon: P3 P3
    • None
    • 1.1.1
    • core-libs
    • None
    • x86
    • windows_95



      Name: mc57594 Date: 07/01/97


      Spawning a process with the exec method will fail if the
      output from the process is sufficiently long. I have used
      exec() to initiate javac, so i don't know if the problem lies
      in the Process class or javac.

      The process in the following code will hang if the output from
      javac, due to errors or warnings, is sufficiently long - about
      20 lines or so:

      (note: try blocks will have to inserted for this to compile)

      String s = "j:\\java\\bin\\javac test.java";
      Process comp = Runtime.getRuntime().exec( sb );
      input = comp.getInputStream();
      error = comp.getErrorStream();
      comp.waitFor();

      /**
       * Code will not get past here.
       */

      byte[] imess = new byte[input.available()];
      byte[] emess = new byte[error.available()];
      input.read(imess);
      error.read(emess);

      if (imess.length > 0) System.out.println(new String(imess));
      if (emess.length > 0) System.out.println(new String(emess));

      return comp.exitValue()==0;


      ======================================================================

            never Tom Rodriguez
            mchamnessunw Mark Chamness (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: