在Elcipse导入项目时提示:editor does not contain a main type的解决方案
来源:互联网 发布:招银网络科技 知乎 编辑:程序博客网 时间:2024/05/18 03:02
今天用eclipse,当打算run一个带有main函数的class时,出现editor does not contain a main type的错误框。
baidu了一下,迅速解决问题:原来这个class所在包没有被添加到build path中。
解决方法:在左侧的package explorer中右击这个class所在包的上一级目录--build path--use as source folder。这样就解决问题了。
重新打开class,再run一下,ok了。
-----------------------------------------------------
补充和解释:
看这张图,src就是在build path中的(仔细观察src的图标)
相对的,resource就只是个普通文件夹,而不在build path中(图标和src不一样吧?)
然后我又在resource下新建了文件夹和文件,比较下,包和文件夹的图标也是不一样的。
现在,我要把resource也加到build path中。(方法就是右击resource--build path--use as source folder)
这样,src和resource就都在build path中了。
最后,解释下,什么叫“在build path中”?你可以这么理解,eclipse中,在build path下的类可以被编译运行,在build path下的配置文件可以被类以相对路径直接读写。
- 在Elcipse导入项目时提示:editor does not contain a main type的解决方案
- editor does not contain a main type的解决方案
- editor does not contain a main type的解决方案
- editor does not contain a main type的解决方案
- Eclipse editor does not contain a main type的解决方案
- editor does not contain a main type的解决方案
- editor does not contain a main type的解决方案
- editor does not contain a main type的解决方案
- eclipse报editor does not contain a main type解决方案
- editor does not contain a main type
- editor does not contain a main type
- editor does not contain a main type
- editor does not contain a main type
- Editor does not contain a main type
- eclipse的editor does not contain a main type错误
- selection does not contain a main type的解决方案!
- Editor does not contain a main type错误提示,怎么解决?
- Editor does not contain a main type 问题解决
- matlab绘制中国地图
- 循环双链表
- Lucas定理证明
- win7 64, matlab2012a文件关联
- JAVA系列-设计模式-责任链模式
- 在Elcipse导入项目时提示:editor does not contain a main type的解决方案
- ortp库使用入门
- android布局设计中不想要listview的分割线,不想滚动列表时条目背景变颜色
- java.lang.OutOfMemoryError的两种解决办法
- 有你要用到的:邮箱输入框+自动补全
- 【wordpress】插件安装
- 使手机浏览器输入www网址自动跳转手机版页面
- 嵌套循环连接
- Java正则表达式 总结