How do I add command-line arguments when running as Java app? [message #267035] |
Thu, 11 December 2008 12:58  |
Eclipse User |
|
|
|
Hi,
I'm using Eclipse 3.4 on WinXP. I want to run a file as a Java
application, so I right-click the file, select "Run As", and select "Java
Application". However at no point in the process am I asked to specify
command line arguments and so my Java app fails with
ArrayIndexOutOfBoundsExceptions b/c "args[0]" has no value.
How do I specify command-line arguments when running Java apps in Eclipse?
Thanks, - Dave
|
|
|
|
Re: How do I add command-line arguments when running as Java app? [message #267055 is a reply to message #267037] |
Fri, 12 December 2008 00:52  |
Eclipse User |
|
|
|
Charlie Kelly wrote:
> Run->Run Configuration
> select your launch configuration
> go to "Arguments" tab
> Supply your arguments as "VM arguments"
Actually, I think Dave wants "Program arguments" since he's referring to
args[0] and not about VM arguments.
The FAQ link below has images to help guide you.
http://wiki.eclipse.org/Graphical_Eclipse_FAQs#How_do_I_add_ arguments_to_the_Java_program_I_am_running.3F
Remy
> D. Alvarado wrote:
>> Hi,
>>
>> I'm using Eclipse 3.4 on WinXP. I want to run a file as a Java
>> application, so I right-click the file, select "Run As", and select
>> "Java Application". However at no point in the process am I asked to
>> specify command line arguments and so my Java app fails with
>> ArrayIndexOutOfBoundsExceptions b/c "args[0]" has no value.
>>
>> How do I specify command-line arguments when running Java apps in
>> Eclipse?
>>
>> Thanks, - Dave
>>
|
|
|
Powered by
FUDForum. Page generated in 0.05261 seconds