无法在STS/Eclipse中找到或加载主类 [英] Could not find or load main class in STS/Eclipse

查看:314
本文介绍了无法在STS/Eclipse中找到或加载主类的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的一个项目中的软件包中有一个主要方法.说,包是com.ant.car.我正在尝试运行和/或调试该主要方法,并且不断收到错误Could not find or load main class com.ant.car.

I have a main method in a package in one of my projects. Say, the package is com.ant.car. I am trying to run and/or debug this main method, and I keep getting the error Could not find or load main class com.ant.car.

我已经搜索了这个问题,似乎我无法弄清楚出什么问题了.

I've searched this problem, and it seems like I can't figure out what is wrong.

1)我已经检查了运行配置.在运行"->运行配置"中,我检查了Main类是否为com.ant.car.

1) I've checked run configurations. In Run->Run Configurations, I've checked that the Main class is com.ant.car.

2)我已经检查了构建路径.如果右键单击该项目,则选择构建"->构建路径",然后在库"选项卡下确保没有丢失带有红色X的文件夹.

2) I've checked build path. If I right click on the project, I select Build->Build Path, and under the Libraries tab I make sure there are no missing folders with red Xs next to them.

不太确定该怎么办.有什么建议吗?

Not really sure what else to do. Any suggestions?

推荐答案

项目->清理

此功能正常

这篇关于无法在STS/Eclipse中找到或加载主类的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆