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

win32 exec does not properly set up environment. Causes failure in exec'd progs

    XMLWordPrintable

    Details

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

      Description

      Runtime.exec() does not set certain crucial env variables. In particular, it does not set WINDIR and SystemRoot, which win95 and winNT programs (respectivly) use to determine the location of the windows directory.

      This bug was discovered in the JavaWebServer, when CGI programs launched from the webserver failed to be able to use network code. It turned out the problem was that the WINDIR env variable needs to be set for winsock to function correctly. Fixing it required inserting win32 specific hacks into the Java code.

      This is similar to setting COMSPEC, which Runtime.exec() already does, so the philisophical arguments should be settled.

      In this case, the fix is to add a check to see if either variable is already set, if they are not set, then they should be added, set equal to the result of GetWindowsDirectory() (within the native code, of course).

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              hongzh Hong Zhang
              Reporter:
              duke J. Duke (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: