editor does not contain a main type" 错误解决方
来源:互联网 发布:qq视频下载软件 编辑:程序博客网 时间:2024/05/04 09:22
from : http://www.cnblogs.com/xwdreamer/archive/2011/01/06/2297048.html
在eclipse下运行一个java程序,但是出现"editor does not contain a main type"错误。后来是因为为的java程序没有放在src目录下,而是另外建立了一个文件夹,在那个文件夹下run程序就会出现前面所提示的错误。解决方法是在src下创建一个package,包名可以同刚才的文件夹名,然后将java程序拷贝过去再run,这时就没有错误了。
下面 from : http://blog.csdn.net/huazhangena/article/details/7349044
我是右击src--build path--use as source folder,估计以前是删除了工程中的部分东西,如果针对其他文件夹报错的会出现很多,不要担心,再remove source folder就行了,记得运行之后重启,还有包估计要重新rebuild source一下。
今天用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" 错误解决方法
- 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
- Editor does not contain a main type
- Eclipse 软件 Java 解决:出现的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的解决方案
- 关于响应事件
- linux命令split用法
- 一句话总结GOF的23种设计模式
- 图像处理--傅里叶图像及傅里叶变换
- Myeclipse 2013 professional 破解,下载
- editor does not contain a main type" 错误解决方
- Android异步处理四:AsyncTask的实现原理
- ”鼠标手“一族的福音---无线悬浮鼠标【转载】
- YII 小模块功能
- singleton 模式的cpp实现和实例
- Win Server 2012R2组件服务中的DCOM配置找不到Microsoft Excel应用程序的解决办法 .
- C++短路求值
- QT移植总结
- 实用的JS正则表达式 (正数正则、IP正则、邮编正则等)