转自:https://blog.csdn.net/github_35160620/article/details/52157912

Eclipse 软件 解决:出现的 editor does not contain a main type 错误框 问题

当你运行 Java文件是,如果弹出了下面的 错误框

Eclipse 软件 Java 解决:出现的editor does not contain a main type错误框 问题

出现错误的原因: 当前的源代码(所有的包)没有被添加到build path中:(src路径里面是文件目录的样子

Eclipse 软件 Java 解决:出现的editor does not contain a main type错误框 问题

解决方法: 对着:src 路径右键 -> Build Path -> Use as Source Folder

Eclipse 软件 Java 解决:出现的editor does not contain a main type错误框 问题

现在,src路径 应该是下面这个样子的:(不再是文件目录的样子了,而是Java包的样子)

Eclipse 软件 Java 解决:出现的editor does not contain a main type错误框 问题

搞定,现在在运行程序,eneditor does not contain a main type错误框就不会在出现了。


参考网站: 
使用eclipse运行带有main函数的Java文件时,出现editor does not contain a main type的错误框 
http://blog.csdn.net/zt689/article/details/22161909


相关文章:

  • 2021-07-16
  • 2021-09-04
  • 2021-09-04
  • 2022-12-23
  • 2021-11-10
  • 2021-10-31
  • 2021-06-28
  • 2022-01-21
猜你喜欢
  • 2021-04-27
  • 2022-12-23
  • 2021-04-23
相关资源
相似解决方案