Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » Java main() method does not run from right-click, but does run from Run Configurations(Java main() method does not run from right-click, but does run from Run Configurations)
Java main() method does not run from right-click, but does run from Run Configurations [message #641186] Wed, 24 November 2010 14:03 Go to next message
Joshua  is currently offline Joshua Friend
Messages: 2
Registered: November 2010
Junior Member
If I right click on a class with a main() in it and choose Run as Application (or Debug) I get an error message "Editor does not contain a main type."

But when I go to Run Configurations and manually create a configuration for it, the class does run.

I confirmed that this class is in the source path for the main codebase of the project (as opposed to test classes).

Interestingly, other classes, in the test source-path for the project, do run from right-click.

What could be causing this?
Re: Java main() method does not run from right-click, but does run from Run Configurations [message #641416 is a reply to message #641186] Thu, 25 November 2010 11:20 Go to previous messageGo to next message
Dani Megert is currently offline Dani MegertFriend
Messages: 3802
Registered: July 2009
Senior Member
Joshua wrote:
> If I right click on a class with a main() in it and choose Run as
> Application (or Debug) I get an error message "Editor does not
> contain a main type."
Where (editor, Package Explorer, ...) do you right click? If you can
provide steps then please file a bug report against JDT Debug.

Dani
> But when I go to Run Configurations and manually create a
> configuration for it, the class does run.
>
> I confirmed that this class is in the source path for the main
> codebase of the project (as opposed to test classes).
>
> Interestingly, other classes, in the test source-path for the project,
> do run from right-click.
>
> What could be causing this?
>
Re: Java main() method does not run from right-click, but does run from Run Configurations [message #641430 is a reply to message #641416] Thu, 25 November 2010 12:58 Go to previous message
Joshua  is currently offline Joshua Friend
Messages: 2
Registered: November 2010
Junior Member
>Where (editor, Package Explorer, ...) do you right click?
> If you can provide steps then please file a bug
> report against JDT Debug.

The bug occurred both from Package Explorer and from the main body of the Editor. It occurred for both Run and Debug.

In addition, Find References for any method would always find zero references; though the feature worked for classes.

Also, an attempt to refactor, e.g., a method signature, caused an error.

I built a completely new workspace from my SCC and so managed to work around the problem.
Previous Topic:[eclipse 3.6] Antrunner is run on debug mode but cant watch variables
Next Topic:Enumeration example from JLS3, isn't accepted as valid in Eclipse
Goto Forum:
  


Current Time: Thu Apr 18 16:11:37 GMT 2024

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

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

Back to the top