错误: 在类中找不到 main 方法, 请将 main 方法定义为:public static void main(String[] args)否则 JavaFX 应用程序类必须扩展javafx.ap

最近在使用eclipse编写java程序时遇到这样一个问题:
错误在类中找不到main方法,请将main方法定义为 public static void main(String[] args)否则 JavaFX 应用程序类必须扩展javafx.application.Application

看到这样的问题让我一头雾水,因为main方法已经写出
这里写图片描述

解决这个问题可以点开eclipse ->window->preference->run and debug->Lunching
这里写图片描述
把第一行改为 always

再次运行代码:
这里写图片描述
可以看出问题已经解决
http://hellolb.top

猜你喜欢

转载自blog.csdn.net/liu1340308350/article/details/80746671