Skip to content
Advertisement

How do I parse command line arguments in Java?

What is a good way of parsing command line arguments in Java?

Advertisement

Answer

Check these out:

Or roll your own:


For instance, this is how you use commons-cli to parse 2 string arguments:

JavaScript

usage from command line:

JavaScript
Advertisement