2

I got this message when running my project in Eclipse, and I am sure that I have a main in my project. I tried cleaning, closing and re-opening it, but nothing works. Can anyone help me please?

user451587
  • 385
  • 2
  • 8
  • 21

3 Answers3

1

The currently opened source code doesn't have a public static void main(String[] args) method. Ensure that you're opening and focusing the right source code which contains the method and then press Ctrl+F11 to execute it.

BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
0

Sometimes you can get this error if your .java file is misplaced outside the src folder..

Try to verify that you .java file is under src folder.

user2399432
  • 738
  • 1
  • 9
  • 17
0

It could be many things.

Try to clean your workspace first and check your configuration used to start your project.


Resources :

On the same topic :

Community
  • 1
  • 1
Colin Hebert
  • 91,525
  • 15
  • 160
  • 151