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 argument processing. This leaves you two alternatives:

This Topic will attempt to cover some of the more popular 3rd-party libraries. For an extensive list of the alternatives, see this answer to the StackOverflow 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:


Command line argument processing:
* Command line Argument Processing

Table Of Contents
8 Arrays
10 Maps
11 Strings
25 JAXB
29 Enums
32 Audio
41 Scanner
63 Logging
75 Lists
78 Sets
89 JAX-WS
96 XJC
98 Process
99 Command line argument processing
106 Modules
114 Applets
122 JNDI
139 JavaBean
141 Literals
144 Packages
150 JMX
153 JShell
159 Sockets
167 Enum Map
175 Hashtable
177 SortedMap