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 21931 - Why must the main class be selected in order to start the debugger (F5). "[FFJ CUSTBUG]"
Summary: Why must the main class be selected in order to start the debugger (F5). "[FF...
Status: CLOSED FIXED
Alias: None
Product: debugger
Classification: Unclassified
Component: Code (show other bugs)
Version: 3.x
Hardware: All All
: P4 blocker (vote)
Assignee: issues@debugger
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-03-27 18:53 UTC by kishm
Modified: 2010-04-29 09:09 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 kishm 2002-03-27 18:53:38 UTC
"[FFJ CUSTBUG]"

Hi there,

an EOU or new feature submitted by a customer.

Description:
It is annoying that I must select the Main class in my 
project before I start the debugger (F5).
If I don't, I get the error
java.lang.NoSuchMethodError: main
Exception in thread "main"
I have set the main class already, so Forte knows which is 
the main class.


FFJ Support Engg Comment :

I know that a given class may be invoked by more than one 
main class or so, but the Ide should have a good way of 
handling it maybe pop up a dialog with list of mains 
asking which you wanna run or something.

Kishore
Comment 1 Marian Petras 2002-03-27 20:08:28 UTC
If you have set the project's main class, you can invoke action "Debug
Project" (Ctrl-Shift-F5), accessible from the main menu:
Project->Debug Project.

A survey says that many users expect the current behaviour and another
big group of users expect that F5 invokes the project's main class.
But neither of these groups of users is significantly higher that the
other.
Comment 2 Jan Jancura 2002-03-28 10:02:45 UTC
What we can do is: if main class is set we can ask user (after F5) if
she want to start project main class or current one. Doe it make sense?
Comment 3 Marian Petras 2002-03-28 10:42:01 UTC
To be pedantic:

The dialog would be displayed only if the selected class is not the
project's main class and both classes (the project's main class and
the selected class) are executable.

Is it correct?
Comment 4 kishm 2002-03-28 23:41:13 UTC
Hello I guess I didnt explain myself clearly here sorry, I 
entered this bug.

Now lets say you have a class A which does not have a main 
method in it and I start the debugger from there , then 
now FFJ tries to execute that class itself and complains 
java.lang.NoSuchMethodError: main. Its dumb cause 
obviously there is no main method in this class (the user 
knows it but expects it to execute the main class for the 
project) , so the user is forced to start the debugger 
from the class with the main method which inturn invokes 
the class A.


Instead there are different things that the user may want 
at this point. So dispalying a dialog with the following 
options and asking him what he wants to do is useful and 
the dialog must allow him to set one behaviour as default, 
then the dialog should not appear each time or whatever. 
User must be able to change his setting later.

the options are
1) do you want to execute this class?
2) Do you want to execute the main class that invokes this 
class.

If he chooses option 2 and there are more than 1 main 
classes ( I mean a class that has a main method in it) 
that invoke class A's methods (from which we started the 
debugger) , then it should show a list and ask which one 
you want to run.

Hope it clarifies things.
Comment 5 Marek Grummich 2002-07-22 09:18:19 UTC
Target milestone was changed from '3.4' to TBD.
Comment 6 Marek Grummich 2002-07-22 09:21:02 UTC
Target milestone was changed from '3.4' to TBD.
Comment 7 Martin Entlicher 2005-05-16 10:30:49 UTC
Fixed by projects integration. By F5 you start to debug the main project.
Comment 8 Quality Engineering 2010-04-29 09:09:53 UTC
Verified ... and Closing all issues resolved into NetBeans 6.7 and earlier.