Passing parameters to main function

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Passing parameters to main function

Papa
Is there a way to pass parameters to a program's main(int, char**)  
using NetBeans? The same as if I type 'program_name param' at the  
prompt.
TIA

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Passing parameters to main function

Geertjan Wielenga-3

I'm assuming we're talking about a Java SE application. Right-click it
in the Projects window, choose Properties, and go to the Run tab. Use
the Arguments field.

Thanks,

Gj


On 10-7-2017 22:57, [hidden email] wrote:
> Is there a way to pass parameters to a program's main(int, char**)
> using NetBeans? The same as if I type 'program_name param' at the prompt.
> TIA
>

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Passing parameters to main function

tusharvjoshi
If you are using Java SE Ant based project, you have one more option to install RUnWith Args plugin and choose Run With Arguments option in Context or Run menu

with regards
Tushar
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Passing parameters to main function

Simon Roberts-4
Guys, he described the prototype of a C main, not Java... Not sure if that changes things...

On Jul 11, 2017 6:21 AM, "Tushar Joshi" <[hidden email]> wrote:
If you are using Java SE Ant based project, you have one more option to install RUnWith Args plugin and choose Run With Arguments option in Context or Run menu

with regards
Tushar
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Passing parameters to main function

Papa
In reply to this post by Geertjan Wielenga-3
Yes, geertjan, you assumed correctly.
I tried what you advised and it worked perfectly.
Thanks so much.

On 2017-07-10 17:11, geertjan wielenga wrote:

> I'm assuming we're talking about a Java SE application. Right-click it
> in the Projects window, choose Properties, and go to the Run tab. Use
> the Arguments field.
>
> Thanks,
>
> Gj
>
>
> On 10-7-2017 22:57, [hidden email] wrote:
>> Is there a way to pass parameters to a program's main(int, char**)
>> using NetBeans? The same as if I type 'program_name param' at the
>> prompt.
>> TIA
>>
Loading...