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.
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.
- duplicates
-
JDK-7158633 No way to read the dynamic system property set in other command line options
-
- Closed
-