Link to home
Start Free TrialLog in
Avatar of gudii9
gudii9Flag for United States of America

asked on

program arguments vs VM arguments

Hi,

In eclipise when i right click on a junit test class and select run configuration then there is Test, Argument, Classpath, JRE, Source, etc tabs.

under arguments tabs there are two options like Program Arguments and VM arguments.
when to use which one. what is use of each one. please advise
args.png
ASKER CERTIFIED SOLUTION
Avatar of dpearson
dpearson

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of gudii9

ASKER

VM arguments are commands used to start Java itself.  You can do things like increase the heap memory by passing parameters there.

i see my friend passing VM argument like

-Dorg.xyzProj.stub.enabled=true

Not sure why junit test need above kind of stub enabling to by pass DAO and Database etc call through VM arguments?
Avatar of dpearson
dpearson

That's a good question - certainly unusual to use that sort of parameter passing through the VM, but why they're doing that, you'd need to ask your friend.  But that is definitely a way to pass a value to Java itself (i.e the VM) and not your code.