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 179131 - Run menu is disabled for classes with a main in a NetBeans module
Summary: Run menu is disabled for classes with a main in a NetBeans module
Status: RESOLVED DUPLICATE of bug 66422
Alias: None
Product: apisupport
Classification: Unclassified
Component: Project (show other bugs)
Version: 6.x
Hardware: PC Linux
: P4 normal (vote)
Assignee: Jesse Glick
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-12-30 12:38 UTC by wobster
Modified: 2011-04-12 14:30 UTC (History)
0 users

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 wobster 2009-12-30 12:38:57 UTC
I noticed that I can not run a class that has a "public static main(String args[])" method when the class is in a NetBeans module. I know that the thinking was probably that you don't run a module from a main, but many time it is convenient during the development process to create a quick test routine in a main routine for a given class without going to the trouble of creating JUnit tests and such. 

I've noticed similar types of hamstringing in the J2EE projects as well. 

Please enable the "Run" functionality at least on the class level and even on the project level since there may be common test or benchmarking routines that the developer would like to run without having to write JUnit tests or create another J2SE project.
Comment 1 Jesse Glick 2010-10-25 18:02:57 UTC
You can place a class with a main method in the unit test area and run it directly. Demo classes should not be placed in the primary source tree.
Comment 2 wobster 2010-10-26 08:00:12 UTC
Please don't try to dictate how developers do their jobs. If somebody wants to run a particular class with a main method in it so be it. Developers don't need protection from themselves, they just want to get the job done.
Comment 3 wobster 2010-10-26 08:02:25 UTC
Please don't try to dictate how developers do their jobs. If somebody wants to run a particular class with a main method in it so be it. Developers don't need protection from themselves, they just want to get the job done.
Comment 4 Jesse Glick 2010-10-26 16:31:29 UTC
Tested patches welcome. I don't consider a priority for the reasons previously mentioned.
Comment 5 Jesse Glick 2011-04-12 14:30:49 UTC

*** This bug has been marked as a duplicate of bug 66422 ***