Community
Participate
Working Groups
Something very odd going on here. At first seems like just a variable not getting expanded, but then finding that the running app doesn't even get changed VM args when I change them in the Run Configuration. Classic situation: want to specify a -D option to tell logging where to get properties file. The following demonstrates the situation. ${project_loc} gets expanded in program arguments, but not in VM arguments. public class TestLogger { public static void main(String[] args) { System.out.println( args[0] ); String prop = System.getProperty( "java.util.logging.config.file"); System.out.println( prop ); } } The corresponding .launch is: <?xml version="1.0" encoding="UTF-8"?> <launchConfiguration type="org.eclipse.jdt.launching.localJavaApplication"> <stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="TestLogger"/> <stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="${project_loc}"/> <stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="TestLogging"/> <stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Djava.util.logging.config.file=${project_loc}/src/logging.properties"/> <booleanAttribute key="org.eclipse.debug.core.appendEnvironmentVariables" value="true"/> </launchConfiguration> Output is: C:\dev\workspace\TestLogging ${project_loc}/src/logging.properties Clearly, the second line should not read as it does. WORSE STILL. Further testing, trying to use ${workspace_loc:TestLogging} gave teh exact same results as above (i.e. containing ${project_loc}
Created attachment 21259 [details] .project source and .launch files that demonstrate the problem
Originally reported bug is misleading. What is actually happening is that the VM args are set with the following VM entry in launching.prefs for the workspace: <vm id\="0" javadocURL\="http\://java.sun.com/j2se/1.5.0/docs/api/" name\="jdk1.5" path\="C\:\\apps\\jdk1.5" vmargs\="-ea -Djava.util.logging.config.file\=${project_loc}/src/logging.properties"/> TWO things seem to be happening that are unexpected: 1) ${project_loc} (and other variables) is not getting expanded, as if it had been put in the VM arguments section of a launch configuration. 2) It isn't clear what happens when VM arguments appear in both the launch configuration and the default for the VM. Expected behaviour would be that launch configuration takes precident. is when put in as the normal path
The default VM args do not support variables currently. This is an enhancement request. VM args are simply appended (not merged). Deferred for post 3.1 consideration.
dup
marking as dup of newer bug to avoid losing vote. *** This bug has been marked as a duplicate of 118946 ***