java找不到main方法?
我们使用eclipse编写java程序时会遇到这样一个问题:
错误在类中找不到main方法,请将main方法定义为 public static void main(String[] args)否则 JavaFX 应用程序类必须扩展javafx.application.Application
解决方法:
1、检查main函数有无拼错(有时敲键盘太快敲成了mian)。
2、点开eclipse ->window->preference->run and debug->Lunching
立即学习“Java免费学习笔记(深入)”;
把第一行改为 always
再次运行代码即可解决错误。
php中文网,大量的免费Java入门教程,欢迎在线学习!
以上就是java找不到main方法?的详细内容,更多请关注php中文网其它相关文章!
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号