JDK-6192449 : (process) Runtime.exec error message on Windows should be improved
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.lang
  • Affected Version: 5.0u1
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • OS: windows
  • CPU: generic
  • Submitted: 2004-11-08
  • Updated: 2012-10-09
  • Resolved: 2006-04-14
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 6
6 b81Fixed
Related Reports
Relates :  
Relates :  
Description
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

Comments
EVALUATION The message will be improved as part of the fix for 5023243: (process) Error msg on exception is not displayed correctly in Japanese on XP
11-03-2006

EVALUATION The submitter is correct. ###@###.### 2004-11-08 23:51:41 GMT
08-11-2004