Uploaded image for project: 'Code Tools'
  1. Code Tools
  2. CODETOOLS-7902719

jtreg does not expose some critical environment variables on Windows

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: P3
    • Resolution: Unresolved
    • Affects Version/s: jtreg5.1
    • Fix Version/s: jtreg5.2
    • Component/s: tools
    • Labels:
      None
    • Subcomponent:
    • OS:
      generic

      Description

      jtreg by design does not expose all environment variables to its Java children.
      On windows there are certain environment variables which are critical, a test not having access to these can fail in very mysterious ways see: JDK-8248987

      This is the exhaustive list of Windows 10 environment variables.
      https://docs.microsoft.com/en-us/windows/deployment/usmt/usmt-recognized-environment-variables

      I think inheriting the following might be sufficient for now:
      {code}
      CommonProgramW6432=C:\Program Files\Common Files
      CommonProgramFiles(x86)=C:\Program Files (x86)\Common Files
      PROGRAMFILES=C:\Program Files
      ProgramFiles(x86)=C:\Program Files (x86)
      ProgramData=C:\ProgramData
      {code}

      The values for the environment variables above are provided merely for description.

      One can workaround by using this with jtreg:
          -e:NAME
              inherit env var NAME from environment

          -e:NAME=VALUE
              override env var NAME with VALUE

      Use `jtreg --help -e` for more details.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              ksrini Kumar Srinivasan
              Reporter:
              ksrini Kumar Srinivasan
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated: