eclipse解决editor does not contain a main type的方法
来源:互联网 发布:电脑安装软件出现乱码 编辑:程序博客网 时间:2024/05/29 23:23
写在前面的话:我的也出现这个问题,但是解决方法和转发的内容不太一样,原理一样,我是右击src--build path--use as source folder,估计以前是删除了工程中的部分东西,如果针对其他文件夹报错的会出现很多,不要担心,再remove source folder就行了,记得运行之后重启,还有包估计要重新rebuild source一下。
1、今天用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了。
2、src就是在build path中的(仔细观察src的图标)
3、相对的,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下的配置文件可以被类以相对路径直接读写。
- eclipse解决editor does not contain a main type的方法
- eclipse解决editor does not contain a main type的方法
- eclipse解决editor does not contain a main type的方法
- eclipse解决editor does not contain a main type的方法
- eclipse解决editor does not contain a main type的方法
- eclipse/myeclipse 解决editor does not contain a main type的方法
- eclipse解决editor does not contain a main type的方法
- eclipse解决editor does not contain a main type的方法
- eclipse的editor does not contain a main type错误
- Eclipse editor does not contain a main type的解决方案
- Eclipse 软件 Java 解决:出现的editor does not contain a main type错误框 问题
- eclipse报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
- Spring AOP 实现业务日志记录
- 解决Eclipse java项目导出jar包乱码问题
- dev XtraMessageBox按钮显示中文
- 在Linux程序中输出函数调用栈
- jobtracker更换内存方案
- eclipse解决editor does not contain a main type的方法
- Java TCP Socket编程
- 在springmvc项目中使用poi导入导出excel
- MyBatis传入多个参数的问题
- JS日期format
- 多线程-并发三大定律
- 图片的旋转动画
- 随机生成验证码
- Android 更新下载apk 安装apk 打开apk