(process) Runtime.exec() command line parsing has unacceptable behavior on all platform

XMLWordPrintable

    • Type: Bug
    • Resolution: Won't Fix
    • Priority: P4
    • None
    • Affects Version/s: 1.2.0
    • Component/s: core-libs
    • generic
    • generic

      The JLS 20.16.3 requires that the command line parsing use StringTokenizer(cmd)
      in the Runtime.exec(String command). The actual behavior is not acceptable. For example, the command line

      vi "a"

      (6 characters total). All shells(on both unix and win32) will let the child
      process get two argumenets (vi and a), the quote(") must be stripped. However
      the Java will pass them as (vi and "a"), the quotes have not been stripped.

      The following command will get even weird result.

      ls "Program Files"

      The Java command parser will get 3 arguement as

      ls
      "Program
      Files"

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

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: