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

  Рет қаралды 30,130

Vikas Maury

Vikas Maury

2 жыл бұрын

could not find or load main class error in java vs code
java.lang.classnotfoundexception vscode
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

Пікірлер: 56
@namratapatil8692
@namratapatil8692 Жыл бұрын
thank you so much i saw lot of videos but no one tell this approach . very helpful
@armonywhite680
@armonywhite680 10 ай бұрын
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
@OnstreamGaming
@OnstreamGaming 27 күн бұрын
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 .
@vikasz2
@vikasz2 25 күн бұрын
Glad to help you. Keep coding.
@d.d5554
@d.d5554 Жыл бұрын
in my case there is no "code runner executor map" section in the code.Then i have to add it, yeah now it worked
@KUKUFMTUSHAR
@KUKUFMTUSHAR 5 ай бұрын
How to add this map
@aniruddahpaul5537
@aniruddahpaul5537 2 ай бұрын
Thanks Man, The first method worked for me
@Prince-9871
@Prince-9871 Күн бұрын
Wow sir thank you.. 😭😭 Finally chal gya.. 🤧😭😭
@gireeswar18
@gireeswar18 27 күн бұрын
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
@vikasz2
@vikasz2 25 күн бұрын
Thanks for the appreciation.
@pokemonfanbeast393
@pokemonfanbeast393 Жыл бұрын
Thanku so much very helpful
@alphonse7133
@alphonse7133 2 ай бұрын
Very helpful brother..... thanks you
@anshumangupta7820
@anshumangupta7820 10 ай бұрын
+ ~ Missing argument in parameter list. + CategoryInfo : ParserError: (:) [], ParentContainsErrorRecordException + FullyQualifiedErrorId : MissingArgument aapne bola vo krne ke baad ye error dikha raha hai please help
@DeathIsTheEndOfLife
@DeathIsTheEndOfLife 10 ай бұрын
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
@aaa-ve8hl
@aaa-ve8hl 9 ай бұрын
did it work?
@dollyprajapati7649
@dollyprajapati7649 24 күн бұрын
Thankyou it's very helpful 😊😊
@vikasz2
@vikasz2 24 күн бұрын
Happy to help
@iamharsha8679
@iamharsha8679 11 ай бұрын
nice one it worked in vs code but when i try to run in cmd it shows the same error , how to solve this?
@shubhamsahu492
@shubhamsahu492 Жыл бұрын
i don't have written code runner executer map in my vs code..... what should I do ? plzz tell
@vikasz2
@vikasz2 Жыл бұрын
You need to install code runner extension from vscode marketplace.
@porchheng1320
@porchheng1320 9 ай бұрын
thank you very much, it works
@manhwa_monster
@manhwa_monster 6 ай бұрын
Thank you so much bro 😊
@ceae69
@ceae69 27 күн бұрын
thanks, the saving method worked for me
@vikasz2
@vikasz2 25 күн бұрын
Glad I could help
@prajwalawari3144
@prajwalawari3144 6 ай бұрын
when after opening settings when i press that icon in the corner i am not able to see code runner executor map. why?
@vikasz2
@vikasz2 6 ай бұрын
You need to install the code runner from the extensions. If that setting isn't there, the copy the setting from here: "code-runner.executorMap": { "javascript": "node", "java": "cd $dir && javac $fileName && java -classpath . $fileNameWithoutExt", "c": "cd $dir && gcc $fileName -o $fileNameWithoutExt && $dir$fileNameWithoutExt", "cpp": "cd $dir && g++ $fileName -o $fileNameWithoutExt && $dir$fileNameWithoutExt", "objective-c": "cd $dir && gcc -framework Cocoa $fileName -o $fileNameWithoutExt && $dir$fileNameWithoutExt", "php": "php", "python": "python3 -u", "perl": "perl", "perl6": "perl6", "ruby": "ruby", "go": "go run", "lua": "lua", "groovy": "groovy", "powershell": "powershell -ExecutionPolicy ByPass -File", "bat": "cmd /c", "shellscript": "bash", "fsharp": "fsi", "csharp": "scriptcs", "vbscript": "cscript //Nologo", "typescript": "ts-node", "coffeescript": "coffee", "scala": "scala", "swift": "swift", "julia": "julia", "crystal": "crystal", "ocaml": "ocaml", "r": "Rscript", "applescript": "osascript", "clojure": "lein exec", "haxe": "haxe --cwd $dirWithoutTrailingSlash --run $fileNameWithoutExt", "rust": "cd $dir && rustc $fileName && $dir$fileNameWithoutExt", "racket": "racket", "scheme": "csi -script", "ahk": "autohotkey", "autoit": "autoit3", "dart": "dart", "pascal": "cd $dir && fpc $fileName && $dir$fileNameWithoutExt", "d": "cd $dir && dmd $fileName && $dir$fileNameWithoutExt", "haskell": "runhaskell", "nim": "nim compile --verbosity:0 --hints:off --run", "lisp": "sbcl --script", "kit": "kitc --run", "v": "v run", "sass": "sass --style expanded", "scss": "scss --style expanded", "less": "cd $dir && lessc $fileName $fileNameWithoutExt.css", "FortranFreeForm": "cd $dir && gfortran $fileName -o $fileNameWithoutExt && $dir$fileNameWithoutExt", "fortran-modern": "cd $dir && gfortran $fileName -o $fileNameWithoutExt && $dir$fileNameWithoutExt", "fortran_fixed-form": "cd $dir && gfortran $fileName -o $fileNameWithoutExt && $dir$fileNameWithoutExt", "fortran": "cd $dir && gfortran $fileName -o $fileNameWithoutExt && $dir$fileNameWithoutExt" },
@manojkr2362
@manojkr2362 4 ай бұрын
@@vikasz2 above code gives error give the correct code please
@user-cb1zi7wj2f
@user-cb1zi7wj2f 6 ай бұрын
thank you brother...just liked and sus,,,,,
@eshalal3283
@eshalal3283 7 ай бұрын
I have done the same as you have done in the video still the problem persist even i used powershell as well
@shoebahmad6988
@shoebahmad6988 22 күн бұрын
Same problem brother
@clashervatsal7305
@clashervatsal7305 Ай бұрын
Thanks!
@ashishkoge9325
@ashishkoge9325 6 ай бұрын
thank you so much
@sasmitapallai40325
@sasmitapallai40325 9 ай бұрын
Thank you thank you thank you so much bhaiyaa
@cristianrusso5749
@cristianrusso5749 2 ай бұрын
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 !
@vikasz2
@vikasz2 2 ай бұрын
Thanks for sharing
@hiranmai8478
@hiranmai8478 2 ай бұрын
thankyou
@yafirizkykurniawan327
@yafirizkykurniawan327 5 ай бұрын
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: java.lang.ClassNotFoundException: Pemahaman please help me l suffer from this
@vikasz2
@vikasz2 5 ай бұрын
It usually happens when you code in vscode. Change your filename to something else and then compile and run the bytecode. Hope it helps.
@djprago1970
@djprago1970 3 ай бұрын
worked tnks
@vikasz2
@vikasz2 2 ай бұрын
Good to hear
@tejassurse9475
@tejassurse9475 4 ай бұрын
thanks
@abhisheksingh-uh9fc
@abhisheksingh-uh9fc Жыл бұрын
thnkx
@GARVITRAKHECHA-uy7rp
@GARVITRAKHECHA-uy7rp 4 ай бұрын
nice one thanks
@nightmare2411
@nightmare2411 3 ай бұрын
W vid thank you sm 👍
@sajalchitlangia3033
@sajalchitlangia3033 Жыл бұрын
code: package Assignment1; public class Greeting { public static void main(String[] args) { System.out.println("Hello World"); } } Error: Error: Could not find or load main class Greeting Caused by: java.lang.NoClassDefFoundError: Assignment1/Greeting (wrong name: Greeting) I tried all the steps but still getting the same error
@maanas_sehgal
@maanas_sehgal Жыл бұрын
sammeeee please help me, whenever i add the package, it shows error everytime
@Spedmuel
@Spedmuel Жыл бұрын
Did you find a solution?
@sajalchitlangia3033
@sajalchitlangia3033 Жыл бұрын
@@Spedmuel yeah! Instead of adding the package folder, I just open my vs code in another window with that assignment1 folder!
@maanas_sehgal
@maanas_sehgal Жыл бұрын
@@sajalchitlangia3033 can you please elaborate, like how to do that, idk how but after some time the error doesnt appear anymore but still it's annoying
@VishalMishra-dc7mr
@VishalMishra-dc7mr 7 ай бұрын
​@@maanas_sehgalcan you find the solution plzz help
@harsh4037
@harsh4037 7 ай бұрын
very helpful video but still showing error Error: Could not find or load main class loopHollowSquare Caused by: java.lang.NoClassDefFoundError: loopHollowSquare (wrong name: LOOPS/loopHollowSquare) plzz help me sir🙏🙏🙏🙏
@vikasz2
@vikasz2 7 ай бұрын
NoClassDefFoundError In Java Reasons: Java Virtual Machine is not able to find a particular class at runtime which was available at compile time. If a class was present during compile time but not available in java classpath during runtime. Read the 4th answer in this thread: stackoverflow.com/questions/34413/why-am-i-getting-a-noclassdeffounderror-in-java Hope it helps!
@bandaruharsha2978
@bandaruharsha2978 Жыл бұрын
I have the problem even after updating json settings.
@vikasz2
@vikasz2 Жыл бұрын
try using powershell instead of traditional cmd prompt
@rakshitajaju9868
@rakshitajaju9868 Жыл бұрын
Java.lang.Classnot found exception: com.mysql.cj.jdbc.Driver Could you solve this error using jdk19 and vs code
@vikasz2
@vikasz2 Жыл бұрын
Please look for solution here.... stackoverflow.com/questions/17484764/java-lang-classnotfoundexception-com-mysql-jdbc-driver-in-eclipse Otherwise I'd have to look at your project. You can share your github repo link here.
Java error: could not find or load main class - Fixed
8:08
TubeMint
Рет қаралды 333 М.
Error: Could not find or load main class SOLVED in Java vs code
2:14
United Top Tech
Рет қаралды 74 М.
Iron Chin ✅ Isaih made this look too easy
00:13
Power Slap
Рет қаралды 36 МЛН
Spot The Fake Animal For $10,000
00:40
MrBeast
Рет қаралды 193 МЛН
Best Toilet Gadgets and #Hacks you must try!!💩💩
00:49
Poly Holy Yow
Рет қаралды 22 МЛН
MISS CIRCLE STUDENTS BULLY ME!
00:12
Andreas Eskander
Рет қаралды 20 МЛН
Why The Windows Phone Failed
24:08
Apple Explained
Рет қаралды 204 М.
Java error: could not find or load main class - Fixed
5:17
CodeWithRaj
Рет қаралды 20 М.
Error : Could not find or load main class in Java vs code | Fixed
2:14
Madhavas Education
Рет қаралды 2,4 М.
VR комната ( VR эксперимент/ MADiSON VR )
12:25
Brawl Stars Animation: PAINT BRAWL STARTS NOW!
0:52
Brawl Stars
Рет қаралды 7 МЛН