Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » running Java program problem(running Java program problem)
running Java program problem [message #1721058] Sat, 23 January 2016 07:42 Go to next message
yair azatchi is currently offline yair azatchiFriend
Messages: 1
Registered: January 2016
Junior Member
When i start running my Java program with Java application its tell me: "Selection does not contain a main type"
how can i fix it and start running Java programs normally?
Re: running Java program problem [message #1721216 is a reply to message #1721058] Mon, 25 January 2016 18:32 Go to previous messageGo to next message
Stephan Herrmann is currently offline Stephan HerrmannFriend
Messages: 1853
Registered: July 2009
Senior Member
What did you select when invoking Run as > Java Application?
Was it a Java class with a main method?
Re: running Java program problem [message #1721217 is a reply to message #1721216] Mon, 25 January 2016 18:51 Go to previous message
Erick Hagstrom is currently offline Erick HagstromFriend
Messages: 107
Registered: April 2014
Location: USA
Senior Member
To amplify:

You have to either add to your invoked class a method of the form
public static void main(String[] args) {
    // your code here
}

or you have to invoke a different class that already has a method of that form.

Note that the method must be public, it must be static, it must return void, it must be named "main", and it must take a single argument of type String[].
Previous Topic:Neon not using "Default VM arguments"
Next Topic:How to get actual IMethodBinding for anonymous class constructor?
Goto Forum:
  


Current Time: Mon Sep 23 20:57:19 GMT 2024

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

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

Back to the top