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

jtreg does not expose some critical environment variables on Windows

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not an Issue
    • Icon: P3 P3
    • jtreg5.2
    • jtreg5.1
    • tools
    • None
    • generic

      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.

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

              Created:
              Updated:
              Resolved: