• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

using the String args[] at main

 
Ranch Hand
Posts: 140
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi all,

i know that in order to use the args[], i can just type the following on my terminal/cmd

java myapp parameter1 parameter2




but how do i utilize the args[] if i am running on eclipse? how do i pass parameter into args?


thanks and regards
bryan
 
Marshal
Posts: 79177
377
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Transferring to the IDEs forum.

Not quite sure, but it is something similar to this:
  • Right-click the name of the class (on the left pane) with the main method in.
  • Click "run"
  • Click "open run dialog"
  • Open the "arguments" tab
  • Write the command-line arguments in the "command arguments" box.
  • Click "run"
  •  
    Sheriff
    Posts: 14691
    16
    Eclipse IDE VI Editor Ubuntu
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    In the menu : Run/Run Configurations...
    Java Application, right-click, New
    In the Arguments tab, you can set the parameters in Program Arguments.
    run_args.JPG
    [Thumbnail for run_args.JPG]
     
    Consider Paul's rocket mass heater.
    reply
      Bookmark Topic Watch Topic
    • New Topic