Problem using command line argument

I am debugging an application that woud normaily use the following command line to start:

java -cp %CLASSPATH% -DLocalConfig=c:\local.cfg -DSC=true -DChannelTrace=true package.StartClass

This causes the application to run fine. There is a jar archive file that uses the -DLocaConfig option and it works when using the Java keyword. However, I have a problem and I need to debug the application. So I set the following as a runtime argument under the project properties:

-DLocalConfig=c:\local.cfg

When I step through with the IDE it looks like this is ignored. If I run from the IDE this ignored. By ignored, I mean setting -DLocalConfig as a runtime argument doesn't seem to propagate to the jar as it does when running the app using the Java command.

I have two questions I'm hoping someone will answer...

(1) Should that be a runtime argument? It is more a system property and is not accessed through the args array of the main method.

(2) If it's not a runtime argument, where should I place the -DLocalConfig option?

[1139 byte] By [HaymakerAJWa] at [2007-11-26 13:04:56]
# 1
Can u try setting it in 'VM Options' instead of 'Arguments' in the Run category in the project properties dialog?
KarthikRa at 2007-7-7 17:11:26 > top of Java-index,Development Tools,Java Tools...
# 2
Hi Kartik,Thanks for replying. Yes, I've tried it in both the Arguments field and the JVM Options field.J.
HaymakerAJWa at 2007-7-7 17:11:26 > top of Java-index,Development Tools,Java Tools...
# 3

> Should that be a runtime argument? It is more a system property and is not

> accessed through the args array of the main method.

If it is not accessed thru args, then certainly it cannot be specified in 'Arguments' field; the 'Arguments' field values are passed to the main class that is being run. Instead it should be passed as a VM option/

> If it's not a runtime argument, where should I place the -DLocalConfig option?

Can you try specifying "-J-DLocalConfig=c:\local.cfg" in the 'VM Options' field?

KarthikRa at 2007-7-7 17:11:26 > top of Java-index,Development Tools,Java Tools...
# 4
Hi Karthik,I tried that and it still did not work. Any other suggestions?Thanks for your time,Josh
HaymakerAJWa at 2007-7-7 17:11:26 > top of Java-index,Development Tools,Java Tools...
# 5

Passing to 'VM Options' should work so it is a bit confusing that it does not.

Can u try the following:

- Close the ide.

- Open <ide_install_dir>/ide/etc/jstudio.conf file

- Add "-J-Dlocalconfig=<value>" to default_options

- Restart the ide.

Adding something to jstudio.conf affects the entire ide and is not the correct thing to do; project-specific options should be made available only to that project. Still, can u try this and see if it works at all?

KarthikRa at 2007-7-7 17:11:26 > top of Java-index,Development Tools,Java Tools...
# 6
By the way, the application you are discussing is a standalone java application, right? (For web applications, the system variables should be defined at the server's jvm...)
KarthikRa at 2007-7-7 17:11:26 > top of Java-index,Development Tools,Java Tools...