使用eclipse运行带有main函数的Java文件时,出现editor does not contain a main type的错误框

来源:互联网 发布:2k17贝克汉姆捏脸数据 编辑:程序博客网 时间:2024/05/29 19:41

使用eclipse运行带有main函数的Java文件时,出现editor does not contain a main type的错误框

        今天从SVN上更新了一下程序,使用用eclipse时,打算运行带有main函数的Java文件时,却

出现editor does not contain a main type的错误框。于是问了一下度娘,问题迅速得到了解决:原

来这个class所在包没有被添加到build path中。

        解决方法:在左侧的package explorer中右击这个class所在包的上一级目录

--build path--use as source folder。这样就解决问题了。重新打开class,再run一下,ok了。

0 0
原创粉丝点击