JDK-4115037 : win32 exec does not properly set up environment. Causes failure in exec'd progs
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.lang
  • Affected Version: 1.1.5
  • Priority: P3
  • Status: Closed
  • Resolution: Duplicate
  • OS: windows_95,windows_nt
  • CPU: x86
  • Submitted: 1998-02-24
  • Updated: 1998-04-15
  • Resolved: 1998-04-15
Related Reports
Duplicate :  
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).

Comments
WORK AROUND Use native code.
11-06-2004

SUGGESTED FIX WINDIR (win95) SystemRoot (winNT) 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).
11-06-2004

PUBLIC COMMENTS 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.
10-06-2004

EVALUATION This bug has been fixed in 1.2 along with other Runtime.exec() bug. ###@###.### 1998-04-14
14-04-1998