Home

Awesome

Java command-line parsing libraries

Link to raw JSON file

The raw .json file is available from this link: https://raw.githubusercontent.com/timtiemens/javacommandlineparser/master/java-parsers.json

Top Ranking Java command-line parsing libraries

  1. JCommander
  2. picocli
  3. args4j
  4. JewelCLI

Alphabetical list of Java command-line parsing libraries

Below is a table showing Java command-line parsing libraries, sorted by name. "Rank" is my rank for the library (1 to 4, or blank). "Annotation" indicates the library uses Java annotations for argument metadata (i.e. "good"). "KeyValue" indicates that the library uses Java map structures to store and access the arguments (i.e. "bad").

NameRankLangAnnotationKeyValueNotes
AirlinejavaX
argotscalaabandoned - see scopt
argparse4jjava
argparserjavaXcreate individual options, where options are "holders", parse() into the holders
args4j3javaXfield-based, unclear if "--long-Name" is supported
clajrjava
cli-parserjava
CmdLnjavaX
CommandlinejavaX
DocOpt.javajavaXweird String-based approach to defining argument names and help at the same time. port of docopt.
dolphin getoptjava
DPML CLIjavaJakarta Commons CLI2 fork
Dr. Matthias Lauxjava
Jakarta Commons CLIjavaXlike JArgs, except key is "String", not an Option object
jargojavaX
jargpjava
JArgsjavaXsingle "parse" call with array of options, key is an Option object
java-getoptjava
jbockjavaX
JCLAPjava
jcmdlinejava
JCommander1javaXgood documentation, custom parser, validation
JCommandojavagenerates .java, but still requires an additional .jar
JewelCLI4javaXinterface-based but can be instance-based with setters
JOpt simplejavaX
JSAPjavaXold (2008) not well documented
naturalclijava
Object Mentor CLI article dead linkjava
optionalscalamultiple github forks
parse-cmdjava
picocli2javaXgood documentation - documentation looks suspiciously like it is patterned after JCommander
ritoptjava
Ropjava
scoptscala
TE-Code Commandjava

Important Features in Command-Line Parsing Library

References