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

(process) Can't execute commands containing '/' on Windows; must use backslash

    XMLWordPrintable

    Details

    • Subcomponent:
    • Resolved In Build:
      b46
    • CPU:
      generic
    • OS:
      windows_2000

      Description

      Java APIs on Windows consistently allow users to specify paths using
      either regular slashes or backslashes.

      Unfortunately, for the specific case of executable names, this fails.
      For example,

      Runtime.getRuntime().exec(new String[]{"C:/WINNT/System32/cmd.exe", "/C", "CD"})
      fails with Windows Error=2 (file not found)

      This is worse because the same Runtime.exec API has not problems when
      the directory is being specified - that can use forward slashes.

      ###@###.### 2004-03-02

        Attachments

          Activity

            People

            Assignee:
            martin Martin Buchholz
            Reporter:
            martin Martin Buchholz
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: