editor does not contain a main type的解决方案
来源:互联网 发布:java商场系统 jeshop 编辑:程序博客网 时间:2024/05/17 00:17
转自: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" 错误解决方法
- 冒泡排序
- 设计模式之单例模式面试总结
- svm之使用SVM(斯坦福machine learning week 7)
- 参数的传值方式与传地址方式
- 支持原创
- editor does not contain a main type的解决方案
- 28. Queue
- 除了发外链seo人还能干什么
- 金蝶K3即时库存成本计算逻辑是什么?
- 树形dp
- 黑白棋(落子)绞尽脑汁 与老师模式强烈不兼容的思路(不推荐)
- gw
- 【cmd】IF ELSE 复制(copy)文件问题
- 有哪些好的刷题网站?2017年最受欢迎的编程挑战网站