0

I have Eclipse Galileo. I created a new Java project but couldn't run the application. I get the following launch error:

Selection does not contain a main type

The sample error screenshot

ROMANIA_engineer
  • 54,432
  • 29
  • 203
  • 199
Nava
  • 6,276
  • 6
  • 44
  • 68

3 Answers3

4

Change the method signature to

public static void main(String[] args) 

and retry.

lobster1234
  • 7,679
  • 26
  • 30
0

The signature of the main method is shown below:

public static void main(String[] args)

Also, the following link may be beneficial for you:

http://download.oracle.com/javase/tutorial/getStarted/application/index.html

Cyril Deba
  • 1,200
  • 2
  • 16
  • 30
0

Nothing wrong with your environment, there really is no entry point to your project. The main method in the screenshot does not have the String[] args parameter. This is not C/C#/C++. You have to specify the String[] args no matter if you use them or not.

Nick
  • 5,765
  • 5
  • 27
  • 36
  • I didn't use any command line arguments? May i know why java wants that? – Nava Jun 22 '11 at 17:41
  • *That* is the signature of the entry point method for starting a Java-based stand-alone application. I am not able to tell you why Java does not have an alternative zero-arg main method. – Nick Jun 22 '11 at 20:59