java运行main方法时候报editor does not contain a main type错

执行main方法


解决方法:

方法1.有可能当前java类放的不是地方,放错包了

    把当前main方法的类移动到正确的包下,下面main包下错误


方法2.

在左侧的package explorer中右击这个class所在包的上一级目录

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

猜你喜欢

转载自blog.csdn.net/u010125432/article/details/80353198
今日推荐