How to Resolve could not find or load main class Error in Java? | GeeksforGeeks

preview_player
Показать описание
In this video, we're going to discuss how to resolve the “could not find or load main class” error in Java. Whenever we write a Java program and compile it - we need to execute that compiled class file and while executing, if JVM (Java Virtual Machine) doesn't find the .class file with the same name that we've specified then this particular runtime error occurs. So, let's get started with the methods to resolve this error.

This video is contributed by Amrit Anand.
Please Like, Comment, and Share the Video with your friends.

#java #fixerror #howto #javaclass #eclipse #beginner

Install our Android App:

If you wish, translate into the local language and help us reach millions of other geeks:

Follow us on our Social Media Handles -

Also, Subscribe if you haven't already! :)
Рекомендации по теме
Комментарии
Автор

Thank you so much. I've been struggling about this issue for hours.

cliffordkalake
Автор

I'm using vs code instead of the eclipse and I'm running on the command line so how we can solve that problem?

burakakca
Автор

I watched three suggested videos and You solve my problem Thank you!

guzaratube
Автор

You are a life saver! Thank you so much! Subscribed to you too!😊

gamesmartshowsk
Автор

Thank you so very much, you have just saved my life!

raphaelluiz
Автор

my code works fine on my idea but when I run my code online or wants to submit it on Coursera only then this error comes?
what to do?

visheshsharma
Автор

you truly help me a lot! thank you very much

Felipa_OOmed
Автор

actually on my console the current program output is not showing instead it is showing previously runned program output on console
please help me in this regards.

rahulghuge
Автор

i dont want to change the workspace because lot of programs on it ..after going to 1st method still facing same issue ...how to resolve it?

dilshadafzal
Автор

what if the error is on running a jar file? thanks...

angeloalonzo
Автор

Absolutely brilliant teaching...Hope your teaching will be recognized worldwide 🎉🔥🔥🙏

snehakapoor
Автор

oh my godddd it works, thank you so much

vanhongle
Автор

I am not having the option to import libraries!!! I have deleted earlier one!! What do I do nw!!

firdousmulla
Автор

What about my those programs which i have done before in the earlier workspace..

vaishnavibharadwaj
Автор

';', <statement> or new line expected, got 'class

Can anyone give me the solution?

Juliee
Автор

Brilliant video, SOLUTION--- in my case ye problem istrah solve ki keh, - bin - wale folder tak jao or sara route copy kar lo, then go to environment variables, phr, User variables aur System variables dono me path nami variable ko edit kar ke us me, bin wala copied route add kar dayn aur route ke end par aik ; (semicolon) laga dayn... inshaAllah ye error nahi dega.

waqasali
Автор

what if i use vs code as a editor for java...without installing java extension....and then this issue arise ..
stuck ..kindly help

faisal
Автор

facing the same problem in notepad and vscode pls help !

siddhantchauhan
Автор

Okay, now how is this done in MacOS? because I do not see the "different path" option anywhere.

EleazarCed