How to pass console arguments to application in eclipse?
See the run configurations. You can specify arguments. You can even prompt the user for arguments, along with defaults:
${string_prompt:host:127.0.0.1} ${string_prompt:port:9876}
The first prompt is host, with default value 127.0.0.1 filled in. Second pop-up has the prmpt port, with 9876 filled in
- Right-click on your project.
- Go to Debug As > Debug Configurations or Run As > Run Configurations.
- Click the tab that says Arguments.
- Enter in your Program Arguments
- Click Apply or Debug
Instead of just hitting the "Run" icon, select the dropdown box next to it, and choose "Run Configurations". Find your application (or create a Run Configuration for it) and put the command line arguments in the "Arguments" tab. See the docs for more information. It should look like this: