-2

'could not find or load main class'

Yosefahab
  • 62
  • 10
  • This is a very common problem. So, first do plenty of research. Then: if you still get it resolved, then include your setup, and the things you tried in your question. – GhostCat Jan 20 '21 at 13:33

2 Answers2

0

You have to write the pointing to the class with the package as well. What package is your Main class in?

As you can see in your own screenshot, "car" is in red and I think it's wrong.

An example. Good pointing configuration: enter image description here

Bad pointing configuration: enter image description here

You can search the Main class clicking on the right: enter image description here

aepifano
  • 1,225
  • 5
  • 23
  • well the whole project structure is in the image, i see its asking for the package name, ive tried all the combinations.... – Yosefahab Jan 20 '21 at 12:19
  • is there a way to find the package name? other than the code....which i obviously wouldnt be able to run – Yosefahab Jan 20 '21 at 12:24
  • 1
    A good practice in java is to insert the package with the domain in full: com.example.etc ... You wrote it without the ".com" (or other) extension. Start by correcting that. Maybe it causes problems. To search for the package you can click "ctrl + space" or right click to search in explorer. – aepifano Jan 20 '21 at 12:31
0

I would suggest deleting your current run profile, since it does not have any specific configurations.

To recreate just open the desired class and use the play button on the left to run the main method.

RatzzFatzz
  • 126
  • 1
  • 4