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

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

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P3 P3
    • None
    • 1.0.2, 1.1.5
    • core-libs
    • generic, x86
    • generic, windows_95, windows_nt

      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.

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

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: