Could not find main method from given launch configuration

当我把我的Java工程导出为可运行的jar包时,遇到了“Could not find main method from given launch configuration”错误,但是之前一直都是可以导出运行的。

后来我发现在选择launch configuration的时候是一个下拉列表,这些是我以前运行过的程序入口列表。
忘记交代一个事情, 就是我的工程运行类被我移动过包,所以就会出现多个launch。

如果你分辨不清哪个launch是你想要的,简单的做法就是去你的(Eclipse工作空间/.metadata/.plugins/org.eclipse.debug.core/.launches),把这个文件夹下的文件清空,重启eclipse。

重新运行下你的项目(运行后等于会重新自动生成launch主运行文件)

再去导出就可以了。

相关文章:

  • 2021-11-15
  • 2021-10-22
  • 2022-02-07
  • 2022-12-23
  • 2021-07-24
  • 2022-02-09
  • 2022-02-06
  • 2021-10-10
猜你喜欢
  • 2023-03-18
  • 2022-02-07
  • 2021-12-05
  • 2021-08-05
  • 2022-01-08
  • 2021-11-01
相关资源
相似解决方案