From Java in a Nutshell:

The syntax of the jar command is intentionally very similar to that of the Unix tar command. This similarity is the reason why jar uses command options, rather than switches (as the other Java platform commands do).

I was wondering what the differences are between command options and switches? I have understood that they mean the same thing.


1 Answer 1


In the context of jar’s options, the distinction is that jar follows tar’s traditional syntax, rather than the hyphen-prefixed syntax used in other tools. Apart from -C and -J, jar’s options are all single letters, with no “switch character” (- in Unix style). Other Java commands such as jmap use - to introduce all their options, and option names are often longer than a single letter.

In general, you’re right, options and switches are the same. (Some might consider that switches refer specifically to on/off options, I don’t think there’s a general rule.)

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .