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

No way to read the dynamic system property set in other command line options

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Won't Fix
    • Icon: P4 P4
    • tbd
    • 7
    • tools
    • x86
    • windows_7

      A DESCRIPTION OF THE REQUEST :
      Seems currently there is no way to make use of system properties defined using "-D" option while invoking java process, in other java command line options. For example: classpath.

      In the below sample, am trying to access system property "test.dir" set using "-D" option, in my classpath to refer a jar dynamically.

      Sample:
      ----------
      java -Dtest.dir="D:\Test" -cp $test.dir/lib/test.jar

      I understand presently this cannot supported/achieved.

      JUSTIFICATION :
      Lets say we've have a 3rd party executable which launches JVM after reading java options and classpath from a configuration file as shown below,

      JAVA_OPTIONS=-Dtest.dir="D:\Test"
      CLASSPATH=$test.dir/lib/test.jar

      In this scenario, "$test.dir" in the classpath will not evaluate to the value set in the java options.

      I believe this feature may help users in configuring java options and classpath from a configuration file.

            ksrini Kumar Srinivasan
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: