Skip to main content



      Home
Home » Newcomers » Newcomers » How do I add command-line arguments when running as Java app?
How do I add command-line arguments when running as Java app? [message #267035] Thu, 11 December 2008 12:58 Go to next message
Eclipse UserFriend
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 #267037 is a reply to message #267035] Thu, 11 December 2008 13:17 Go to previous messageGo to next message
Eclipse UserFriend
Hi Dave,

Run->Run Configuration
select your launch configuration
go to "Arguments" tab
Supply your arguments as "VM arguments"

Charlie


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
>
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 Go to previous message
Eclipse UserFriend
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
>>
Previous Topic:Toggle Line Breakpoint (epic)
Next Topic:open Perspective from Intro screen?
Goto Forum:
  


Current Time: Sun May 04 03:24:27 EDT 2025

Powered by FUDForum. Page generated in 0.05261 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top