Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Could not find or load main class in STS/Eclipse

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) I've checked run configurations. In Run->Run Configurations, I've checked that the Main class is com.ant.car.

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?

like image 276
aCarella Avatar asked May 25 '16 21:05

aCarella


2 Answers

Project -> Clean

this is working

like image 79
user2241925 Avatar answered Sep 20 '22 01:09

user2241925


Try updating project by right clicking on it. Maven -> Update Project

like image 38
SelvaKumar T Avatar answered Sep 22 '22 01:09

SelvaKumar T