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

(process) Runtime.exec error message on Windows should be improved

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 6
    • 5.0u1
    • core-libs
    • None
    • b81
    • generic
    • windows

      When System.exec fails (for example as a result of the incorrect executable name), it throws IOException. On Windows this exception typically looks something like the following:

      java.io.IOException: CreateProcess: "C:\NOTEPAD.EXE.lnk" error=193
              at java.lang.Win32Process.create(Native Method)
              at java.lang.Win32Process.<init>(Unknown Source)
              at java.lang.Runtime.execInternal(Native Method)
              at java.lang.Runtime.exec(Unknown Source)
              at java.lang.Runtime.exec(Unknown Source)
              at java.lang.Runtime.exec(Unknown Source)
              at java.lang.Runtime.exec(Unknown Source)

      As you see, the error message is rather cryptic. The problem would be easier to diagnose if the error message for this error code is also in the message.

      On Windows, one can easily obtain a human readable message for an error code by using FormatMessage API exposed from kernel32.dll. I see no reason why the the JDK cannot do this.
      ###@###.### 2004-11-08 23:30:33 GMT

            martin Martin Buchholz
            kkawagucsunw Kohsuke Kawaguchi (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: