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

Empty environment array for Runtime.exec does not yield an empty environment.

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P3
    • Resolution: Duplicate
    • Affects Version/s: 1.0.2, 1.1.5
    • Fix Version/s: None
    • Component/s: core-libs
    • Labels:
    • Subcomponent:
    • CPU:
      generic, x86
    • OS:
      generic, windows_95, windows_nt

      Description

      java.lang.Runtime.exec(String[]command, String[] env) says that it will
      execute the command with the given environment. This implies that if the
      environment array is empty, the command should be executed with the
      empty environment. This does not happen; in this case it is executed with
      the environment inherited from the parent process. However, that effect
      can be achieved by passing "null" for the environment array, as compared to
      an empty array.

      Currently, there is no way to execute a command with an empty environment.

      Accidentally inheriting the environment of the parent process can lead to
      some very strange side effects for JavaTest and JCK.

      The bug exists in JDK1.0.2, through to at least 1.1.3.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              hongzh Hong Zhang
              Reporter:
              jjg Jonathan Gibbons
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: