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

解决:测试工具不需要从main方法开始,也就是不用点右上角的绿色三角形启动程序,直接点如图箭头所向绿色启动按钮来测试特定方法

如图:

在IDEA里用junit工具测试时,出现找不到main方法

相关文章:

  • 2021-10-20
  • 2021-09-15
  • 2022-12-23
  • 2021-12-30
  • 2021-06-12
  • 2022-12-23
  • 2021-12-07
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-11-01
  • 2021-05-17
  • 2021-11-10
  • 2021-10-25
相关资源
相似解决方案