-2

I'm unable to run this project due to the error: 'could not find or load main class' im aware this question already exists but im still unable to figure out why.
When i try to call java from the terminal this shows up, i've checked the enviroment variables and there doesnt seem to be anything referencing 'Steve Kollmansberger' (which was a simulator i used to have but now i dont!)

terminal you can clearly see the class path on the left. intellij

General Grievance
  • 4,555
  • 31
  • 31
  • 45
YosefAhab
  • 64
  • 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

Sandman
  • 1,480
  • 7
  • 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. – Sandman 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
  • 144
  • 1
  • 7