| Summary: | Environment variables not expanded in VM arguments | ||
|---|---|---|---|
| Product: | [Eclipse Project] JDT | Reporter: | Jim Sculley <niceguy> |
| Component: | Debug | Assignee: | JDT-Debug-Inbox <jdt-debug-inbox> |
| Status: | VERIFIED WONTFIX | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | ||
| Version: | 2.1 | ||
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Linux | ||
| Whiteboard: | |||
I believe this is OS specific. For example, on Win2000, using $Path from the command line evaluates to the same thing = "$Path". Java does not provide access to environment variables (only system properties). It looks like the variable substitution you are getting on Linux is due to your OS support, not Java. I believe the "proper" way to pass around such values in Java is via system properties, or a properties file. Do not intend to address for 2.1. In 3.0, we support "${env_var:FOO}" which resoves to the value of an
environment variable.
As of now 'LATER' and 'REMIND' resolutions are no longer supported. Please reopen this bug if it is still valid for you. |
When environment variables are included in the parameters passed to the VM by a Launch Configuration, they are not expanded. Here is a simple example: Create the follwing class: public class EnvBug { public static void main(String[] args) { System.out.println(System.getProperty("test.foo.bar")); } } Run the class from the command line and from within Eclipse with this VM parameter: -Dtest.foo.bar=foobar The code works as expected with the output: foobar Next create an environment variable FOO_BAR like this: export FOO_BAR=foobar Now run the code from a command line and from within Eclipse with this VM parameter: -Dtest.foo.bar=$FOO_BAR The command line code works as expected, but the output from Eclipse is: $FOO_BAR which clearly indicates that the environment variable is not being properly expanded. I have not tested this on platforms other than Linux, so I do not know if other OSen are affected.