JDK-4810109 : automate adding of environment variables rather than use -D
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 1.4.0
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • OS: windows_xp
  • CPU: x86
  • Submitted: 2003-01-29
  • Updated: 2003-01-30
  • Resolved: 2003-01-30
Related Reports
Duplicate :  
Description

Name: jl125535			Date: 01/29/2003


FULL PRODUCT VERSION :
java version "1.4.0"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0-b92)
Java HotSpot(TM) Client VM (build 1.4.0-b92, mixed mode)

FULL OPERATING SYSTEM VERSION :
Microsoft Windows XP [Version 5.1.2600]

ADDITIONAL OPERATING SYSTEMS :
any that support environment variables


A DESCRIPTION OF THE PROBLEM :
getenv was removed a long time ago and the workaround
suggested by Sun (java -D...) can be painful when you have
a large number of environment variables that need to be
passed in.

A suggustion is to modify the launcher code for the VM to
perform the getenv call and build all the -Ds that are
needed.  Perhaps the variables could start with "env." -
this keeps them clear and makes life easy for the security
manager to block access to them if so desired (applets for
example).

REPRODUCIBILITY :
This bug can be reproduced always.

---------- BEGIN SOURCE ----------
pseudocode for the change to the launcher is:

void add_env_vars(...)
{
   env = getenv(); /* C code so this call works :-) */
   
   for each var
      add a -Denv.<key>=<value>
}

The key and value are obtained from the getenv call.
---------- END SOURCE ----------

CUSTOMER WORKAROUND :
Pass a large number of unknow and ever changing variables
via -D.

Write your own launcher to do the same thing - not
portable.
(Review ID: 153670) 
======================================================================