Error: Could not find or load main class
已回答
Dears,
I'm new to learning Java, I installed Intellij Idea Community Edition on Windows, Linux and Mac, only on Mac I have a problem when starting Run,
Error: Could not find or load main class
Caused by: java.lang.ClassNotFoundException:
It works fine on Windows and Linux systems.
Do you have an idea.
Thank you very much
BR
Gordan
请先登录再写评论。
Hello Gordan,
There might be an issue with project configuration (e.g. it wasn't imported properly). Is it possible to share screenshots showing project tree and used run configuration? If it's possible to share the project itself we could check it on MacOS machines on our side.
Hi dear Bedrov,
Thx a lot for your reply, I am seending prtScr from IntelliJ, see attached.
The error only occurs on the IOS system, the problem does not occur on Linux and Windows.
Thx a lot and have a nice evening.
BR
Gordan
Gordan,
Thanks for the screenshot. Please try to run “Build | Build project” before execution. Will it help?
Hi dear Jaroslav,
thanks a lot for your kind help.
After creating the project, before creating the class, I ran:
Build --> Build Project and only then created the class and now everything works properly.
Thank you very much for your help.
Have a nice day/evening
Gordan,
You are welcome!
If it's possible please check if the issue occurs with the newly created project. Actually, build should be executed automatically.
hi dear Yaroslav,
I tried several times to open new project without Build-→Buil Project, It looks that everything works fine now automatically.
Thx a lot for all your help.
Have a nice weekend.
BR