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?
['https://Stackoverflow.com/questions/37447721', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/2664815/']
Today I ran into the same problem and I tried a lot of answers. Nothing helped. Cleaning the project, build automatically is already checked, deleting `.metadata`, etc.

Eventually I tried this and it worked perfectly:

menu Project -> Properties  

Java Build Path, tab Libraries

Remove the JRE System Library from there, press `Add Library`, take the JRE System Library and press `Next`. Workspace default `JRE` and press `Finish`.
1 ) Clean the Project   

2 ) Enable build automatically Option  

3 ) Update the maven project by use the short cut `Alt` + `F5`