eclipse解决editor does not contain a main type的方法
2015-01-29 17:54
561 查看
写在前面的话:我的也出现这个问题,但是解决方法和转发的内容不太一样,原理一样,我是右击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下的配置文件可以被类以相对路径直接读写。
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解决editor does not contain a main type的方法
- eclipse解决editor does not contain a main type的方法
- editor does not contain a main type" 错误解决方法
- Eclipse 软件 Java 解决:出现的editor does not contain a main type错误框 问题
- Eclipse 软件 Java 解决:出现的editor does not contain a main type错误框 问题
- "editor does not contain a main type" 错误解决方法
- eclipse/myeclipse 解决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" 错误解决方
- Eclipse下有main函数类运行报错:Editor does not contain a main type
- 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或者Selection does not contain a main type