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

automate adding of environment variables rather than use -D

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Duplicate
    • Icon: P4 P4
    • None
    • 1.4.0
    • hotspot
    • x86
    • windows_xp



      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)
      ======================================================================

            foliversunw Fred Oliver (Inactive)
            jleesunw Jon Lee (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: