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

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

    XMLWordPrintable

Details

    • Bug
    • Resolution: Not an Issue
    • P4
    • None
    • 1.4.0
    • core-libs
    • sparc
    • 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

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

            Dates

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: