Command line Argument Processing

suggest change

Syntax

Parameters

Parameter Details
args The command-line arguments. Assuming that the main method is invoked by the Java launcher, args will be non-null and will have no null elements.

Remarks

When a regular Java application is launched using the java command (or equivalent), a main method will be called, passing the arguments from the command line in the args array.

Unfortunately, the Java SE class libraries do not provide any direct support for command-line argument processing. This leaves you two alternatives:

This topic covers some of the more popular third-party libraries. For an extensive list of the alternatives, see this answer to the Stack Overflow question “How to parse command line arguments in Java?”.

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents