Header javaperspective.com
JavaPerspective.com  >   Intermediate Tutorials  >   1. The Eclipse IDE  >   1.3. Tips about Eclipse  >   1.3.5. How to use command-line arguments in Eclipse

1.3.5. How to use command-line arguments in Eclipse
Last updated: 25 January 2013.

Select the class containing the main method in the package explorer. Right-click the selected class and click Run As -> Run Configurations as shown below:

picture showing the eclipse IDE 34


When you click Run As -> Run Configurations, the dialog box shown below is displayed. Select the Arguments tab and click the Variables button in the Program arguments section:

picture showing the eclipse IDE 35


When you click the Variables button, the dialog box shown below is displayed. Select string_prompt and click OK:

picture showing the eclipse IDE 36


When you click the button OK, the dialog box shown below is displayed. Click Apply to save changes:

picture showing the eclipse IDE 37


When you run your application, you will be prompted to enter command-line arguments in a dialog box as shown below:

picture showing the eclipse IDE 38



You are here :  JavaPerspective.com  >   Intermediate Tutorials  >   1. The Eclipse IDE  >   1.3. Tips about Eclipse  >   1.3.5. How to use command-line arguments in Eclipse
Next tutorial :  JavaPerspective.com  >   Intermediate Tutorials  >   1. The Eclipse IDE  >   1.3. Tips about Eclipse  >   1.3.6. How to use TODO and FIXME task tags in Eclipse

Copyright © 2013 - 2016. JavaPerspective.com. All rights reserved.  ( Terms | Contact | About ) 
Java is a trademark of Oracle Corporation
Image 1 Image 2 Image 3 Image 4 Image 5 Image 6 Image 7