Menu

How to pass command line argument in Java using Eclipse IDE


  1. Right-click on your project or Java class file which you wants to execute.
  2. Go to Debug As > Debug Configurations or Run As > Run Configurations option. this will open a new pop-up window as shown is below screen shot.
  3. Click the tab Arguments.
  4. Enter in your Program Arguments. e.g. agr1, agr2
  5. Click Apply or Run

command line argument in Java using Eclipse IDE
Add command line argument in Java using Eclipse IDE

1 comment: