开发者

Editor does not contain main type in Eclipse

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜