开发者

Editor does not contain main type in Eclipse

开发者 https://www.devze.com 2023-01-16 22:00 出处:网络
I got this message when running my project in Eclipse, and I am sure thatI have a main in my project. I tried cleaning, closing and re-opening it, but nothing works. Can anyone hel开发者_StackOverflow

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

精彩评论

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