SOLVED - Error: Could not find or load main class Main (FIXED 100%)

preview_player
Показать описание
could not find or load main class error in java vs code
could not find or load main class error in java
main method not found in the file vscode
error could not find or load main class
Рекомендации по теме
Комментарии
Автор

Oh man, You saved my life, I am facing this issue since more than a week and struggling to solve it, watched tons of youtube videos and stackoverflow solutions, and even after fighting with chatgpt, i was unable to figure out what actually is causing the error, somehow my code was running from "RUN AS JAVA CODE" but it was irritating too do it every time before run, also earlier everything was fine, suddenly after i played with some environment variables i got this issue, and was unable to resolve it . Really really thanks for this help .

OnstreamGaming
Автор

in my case there is no "code runner executor map" section in the code.Then i have to add it, yeah now it worked

d.d
Автор

thank you so much i saw lot of videos but no one tell this approach . very helpful

namratapatil
Автор

Best video! If you cant find the code runner executor map, install code runner and in the settings.json just type code-runner.executormap and the code wiil appear automatically then modify as mentioned in the video

gireeswar
Автор

Thank u so much i watch a lot of videos expalaining that i have to chage the system variables but it didn't work for me. I'm glad i found your video <3

armonywhite
Автор

I have done the same as you have done in the video still the problem persist even i used powershell as well

eshalal
Автор

Thank you for the video anyway, but...
SOLVED ANOTHER WAY:
No method solved it for me, either of those presented in this video or in others. The only way for me was:
- when compiling, click on the "FIX" option
- then click on the "clear cache" option
... and SOLVED !

cristianrusso
Автор

code:
package Assignment1;
public class Greeting {
public static void main(String[] args) {

}
}

Error:
Error: Could not find or load main class Greeting
Caused by: Assignment1/Greeting (wrong name: Greeting)

I tried all the steps but still getting the same error

sajalchitlangia
Автор

My file name is Autocomplete.java but when I initiate javac Autocomplete.jave It keeps popping an error telling me the file is not found. Please what can I do?

Henschel-ylfl
Автор

Wow sir thank you.. 😭😭
Finally chal gya.. 🤧😭😭

Prince-
Автор

+ ~
Missing argument in parameter list.
+ CategoryInfo : ParserError: (:) [],
+ FullyQualifiedErrorId : MissingArgument
aapne bola vo krne ke baad ye error dikha raha hai please help

anshumangupta
Автор

mine still error after java -classpath . Pemahaman

PS D:\Belajar.java> java -classpath . Pemahaman
Error: Could not find or load main class Pemahaman
Caused by: Pemahaman

please help me l suffer from this

yafirizkykurniawan
Автор

Bro bro bro I was struggling to get this fixed and thanks to your video it's solved now

rajatsharma
Автор

when after opening settings when i press that icon in the corner i am not able to see code runner executor map. why?

prajwalawari
Автор

Sir in my case inside the settings code runner there is 10 line code only even i have installed code runner still not showing that code where i want to edit classpath

DeathIsTheEndOfLife
Автор

i don't have written code runner executer map in my vs what should I do ? plzz tell

shubhamsahu
Автор

nice one it worked in vs code but when i try to run in cmd it shows the same error, how to solve this?

iamharsha
Автор

very helpful video but still showing error
Error: Could not find or load main class loopHollowSquare
Caused by: loopHollowSquare (wrong name: LOOPS/loopHollowSquare)
plzz help me sir🙏🙏🙏🙏

harsh
Автор

thanks, the saving method worked for me

ceae
Автор

Thanks Man, The first method worked for me

aniruddahpaul