editor does not contain a main type的解决方案
来源:互联网 发布:kali linux破解wifi 编辑:程序博客网 时间:2024/06/05 20:57
先感谢下作者 pocky
转自:http://hi.baidu.com/zh_m_zhou/blog/item/8bb9ba025baa98e408fa93fd.html
作者:pocky
今天用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下的配置文件可以被类以相对路径直接读写。
- 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错误
- 在Elcipse导入项目时提示: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" 错误解决方法
- c语言时间函数
- UML建模
- Sea.js基础知识
- test18
- POJ 2017 解题报告
- editor does not contain a main type的解决方案
- test19
- Spring定时任务的简单例子(转载)
- spring与junit结合测试
- test20
- 凤求凰·琴歌
- seajs下require书写约定
- 一切成功源于积累——20141203 命运开始的21时间 一直到26时间才休 美元指数89 美日119.900
- strace