arguments and VM arguments in Eclipse

Eclipse allows you to enter Program arguments and VM arguments into a Debug configuration. I have a Debug configuration for my ArgsTest class, and I pass in “pro1 pro2 pro3” as Program arguments and “-DsysProp1=sp1 -DsysProp2=sp2” as VM arguments.

Program arguments are arguments that are passed to your application, which are accessible via the “args” String array parameter of your main method. VM arguments are arguments such as System properties that are passed to the Java interpreter. The Debug configuration above is essentially equivalent to:

java -DsysProp1=sp1 -DsysProp2=sp2 test.ArgsTest pro1 pro2 pro3
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s