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

执行main方法

java运行main方法时候报editor does not contain a main type错_第1张图片


解决方法:

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

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

java运行main方法时候报editor does not contain a main type错_第2张图片

方法2.

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

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

你可能感兴趣的:(java)