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

Process.waitFor() fails to return

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 1.2.0
    • 1.1.5
    • core-libs
    • 1.2beta4
    • x86
    • windows_nt
    • Not verified



      Name: rm29839 Date: 12/10/97


      Try this little bit of code on a WinNT box - the process.waitFor() call fails
      to ever return. Works fine on HP/Sun/Linux JDK running 1.1.3.

      String command = "C:/dev/jdk/bin/java";
      System.out.println("---> Executing "+command);
      Process process = Runtime.getRuntime().exec(command);
      System.out.println("---> Waiting for completion of waitFor()");
      process.waitFor();
      System.out.println("---> waitFor() completed");

      The waitFor() never returns - fails for all applications

      import java.io.*;
      public class Test {

        public static void main (String[] args){
          try{
          String command = "e:\win32\bin\java";
       //change this to match where your java lives
          System.out.println("--->Executing " + command);
          Process process = Runtime.getRuntime().exec(command);
          System.out.println("--->Waiting for completion of " + command);
          process.waitFor();
          System.out.println("--->Done Waiting!");
        }catch(IOException e){}catch (InterruptedException e){}

        }
      }

      This works fine under 1.1.5 on Solaris, but on win32
      (Review ID: 21666)
      ======================================================================

            hongzh Hong Zhang
            rmandelsunw Ronan Mandel (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: