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 hel开发者_StackOverflow社区p me please?
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.
It could be many things.
Try to clean your workspace first and check your configuration used to start your project.
Resources :
- JavaRanch - active editor does not contain a main type
On the same topic :
- Editor does not contain a main type
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.
精彩评论