Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我在 Eclipse 中运行我的项目时收到了这条消息,我确信我的项目中有一个 main。我尝试清洁、关闭并重新打开它,但没有任何效果。任何人都可以帮助我吗?
当前打开的源代码没有public static void main(String[] args)方法。确保您打开并关注包含该方法的正确源代码,然后按Ctrl+F11执行它。
public static void main(String[] args)
这可能是很多事情。
首先尝试清理工作区并检查用于启动项目的配置。
资源 :
在同一主题上:
如果您的 .java 文件被错放在 src 文件夹之外,有时您会收到此错误。
尝试验证您的 .java 文件是否在 src 文件夹下。