| Author |
Java Command Line Options
|
chander shivdasani
Ranch Hand
Joined: Oct 09, 2007
Posts: 206
|
|
While using Java Options, i found they are of two types. One that has "-" as a prefix and another as "+". For example:
-XX:-UseParallelGC
XX:+UseThreadPriorities
Is there some reason why we have both "+" as well as "-". Initially, i thought that + would mean enabling while - would mean disabling. But, if we want any option disabled than why even pass it along the command line?
|
Enjoy, Chander
SCJP 5, Oracle Certified PL/SQL Developer
|
 |
chander shivdasani
Ranch Hand
Joined: Oct 09, 2007
Posts: 206
|
|
I figured the answer:
"Initially, i thought that + would mean enabling while - would mean disabling"
The official documentation suggests that these options are turned on/off with +/-
"But, if we want any option disabled than why even pass it along the command line?"
That's because some may be enabled and others disabled per default, and this may change between Java releases.
|
 |
Campbell Ritchie
Sheriff
Joined: Oct 13, 2005
Posts: 32701
|
|
|
Most command-line tools have a - before their options.
|
 |
Wouter Oet
Saloon Keeper
Joined: Oct 25, 2008
Posts: 2700
|
|
|
The + and - can be used to turn on and off boolean options of the jvm. For a list of options of the java jvm see this.
|
"Any fool can write code that a computer can understand. Good programmers write code that humans can understand." --- Martin Fowler
Please correct my English.
|
 |
 |
|
|
subject: Java Command Line Options
|
|
|