This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 58709 - Support runtime arguments for main() method
Summary: Support runtime arguments for main() method
Status: RESOLVED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Project (show other bugs)
Version: 4.x
Hardware: All All
: P3 blocker with 10 votes (vote)
Assignee: jrojcek
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-05-09 16:34 UTC by tkellerer
Modified: 2007-05-28 09:01 UTC (History)
1 user (show)

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description tkellerer 2005-05-09 16:34:16 UTC
With NB 3.6 I could right click on any class, select Properties and supply
arguments that would be passed to the main() method of the class when running
the class. 

With NB 4.1 this is not possible any more (only for main class of J2SE
projects). This is even more annoying for classes inside a web application
project where I can't even set up a main class as a workaround.
Comment 1 Milan Kubec 2005-05-19 08:57:37 UTC
Reassigning for evaluation, but it's more RFE than DEFECT, because it's was
designed that way.
Comment 2 Tomas Zezula 2005-05-19 09:10:15 UTC
Agree that this is an enhancement.
Technically it is quite easy the arguments for the classes will be stored in the
private project data and passed to the Ant by the J2SEActionProvider. But it
requires an UI change. Letting Jano to decide.
Comment 3 tkellerer 2005-05-19 09:39:03 UTC
I deliberately set it to defect, because from a user's point of view this is a
regression as it was working with NB 3.6
Comment 4 gholmer 2005-06-03 13:07:06 UTC
Important for a project that has e.g. a number of small console programs that
take command-line arguments.  It's inconvenient to have to change the project
properties each time you want to test one of them, or worse yet, create a
project for each.

Comment 5 hellorsanjeev 2006-02-07 07:41:20 UTC
I agree with gholmer@netbeans.org as it is really annoying when u have to open a
dialog and set the main class first and then u have to set the arguments. There
should be some way by which I can specify cmd-line arguments on class to class
basis with out changing them all the time.

sanjeev.dhiman@induslogic.com
Comment 6 dscomeau 2006-02-23 22:24:38 UTC
Another bump.  This is a very useful feature, and I can't believe that more
people haven't voted for this.  I use several custome code generation utility
classes that I feed XML filenames to on the command line.  In 3.6, it was a
breeze, now I have to do this from the command line with a batch file.  What a
pain.  Please consider providing this feature again.
Comment 7 dscomeau 2007-05-27 14:48:18 UTC
Just another thought on this one.  I've now moved to using more free-form
projects, and with those, I can overcome this limitation.  I configure two
properties in a build.properties file called ${run-single.jvm-args} and
${run-single.args}.  This issue doesn't mention the JVM args, but it might be
good to put this in as well if this does get implemented?
Comment 8 Jiri Prox 2007-05-28 09:01:12 UTC
This feature is implemented in 6.0, you can create several run configuration
(runtime arguments, main class, JVM arguments) and then switch them in combobox
in the main window.