[英]eclipse could not find main class
I am trying to run a java program that has 3 classes and an .aj file. 我正在尝试运行具有3个类和.aj文件的Java程序。 I have my main named Main.class.
我的主名为Main.class。
When I'm trying to run my program it says it could not find my main class, even though it's right there. 当我尝试运行程序时,它说找不到正确的主类,即使它在那里。
Eclipse is trying to run
prob1.Main
which doesnt exist. Eclipse尝试
run
不存在的prob1.Main
。 By looking at your class you commented
the package
name. 通过查看您的课程,您
commented
了package
名称。 Try recompiling your class again and run
it. 尝试再次重新编译您的类并
run
它。
Don't comment out the: 不要注释掉:
package prob1;
The only time you don't need to write the package is when you are using the default package for a project (which is created automatically when you create a class in a new project). 唯一不需要写该软件包的时间是当您为项目使用默认软件包时(在新项目中创建类时会自动创建该默认软件包)。 Edit the code snippet and then run the program again and it should be fine.
编辑代码段,然后再次运行该程序,应该没问题。 Hope this helps.
希望这可以帮助。
SomeTimes eclipse get corrupted run configuration...... For that issue three solution is there 有时eclipse的运行配置损坏了……对于该问题,存在三种解决方案
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.