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

(process) why do we need Thread.sleep after Runtime.getRuntime().exec(cmd)?

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P4
    • Resolution: Not an Issue
    • Affects Version/s: 1.4.0
    • Fix Version/s: None
    • Component/s: core-libs
    • Labels:
    • Subcomponent:
    • CPU:
      sparc
    • OS:
      solaris_7

      Description

      on solaris:

      test case at: (test.java also attached in this bugreport)

      http://web-east.east/~ngthomas/exec_bug/

      with java 1.4:

      test.java suppose to launch netscape with Runtime.getRuntime().exec()

      However netscape will only be launch if there is Thread.sleep after exec()

      try:

      java test -> nothing happens

      java test sleep -> netscape launches

      why?

      if you change netscape to dtterm, it will work even if thread.sleep is not called. but since runtime.exec suppose to run the command in a separate process, it should not matter how long does it take for the application to launch right?

        Attachments

          Activity

            People

            • Assignee:
              martin Martin Buchholz (Inactive)
              Reporter:
              ngthomas Thomas Ng (Inactive)
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Imported:
                Indexed: