Error: Could not find or load main class SOLVED in Java vs code

preview_player
Показать описание
How to solve error could not find or load main class in java in visual studio code is shown
Рекомендации по теме
Комментарии
Автор

Thankyou so much Sir ! This video really help me.
There are so many videos available but yours video provide better solution!

shortsWithAashish
Автор

OOOO MAAAA GAAWWWWDDD!!!, I exhausted my psyche to iron this STUPID WRINKLE and your assist actually healed the spot, THANKS A LOTT! :)

arxsh
Автор

I wasted my 2 hours to solve this problem, and it's just a simple, put the your class name same as file name
I'm totally shocked on this thing 😂😂😂😂🎉
Thank you ❤

rahulrathod
Автор

thanks for this it really solved my problem

vipul
Автор

This helped! My solution was the java environment path.
Thank you!

marcoabas
Автор

In my case when i compile my java file it doesn't create class file for that java file and i run this file it show me error couldn't find or load main class. How i resolve it ?

mr_trader
Автор

Thank you very much for your great help. The 4rth reason was my case. Many many thanks!

laloquera
Автор

Thank you so much sir
Mai bahut pareshan ho gayi tha
But still fine

ankitachauhan
Автор

thankyou, tis is my 7 video and now my problem is solved, thanks a lot

chilllofiboy
Автор

But in Before whem i execute AWT program, when i click run java It automatically produce output..but Now Always Showing Could not load Main Class

handsomyash
Автор

One of the possible causes is the language of the file/folder name. My problem was solved after I changed all folder/file names in the path of Java's file I wanted to run into English.

Ggbebe
Автор

Hi Sir, I'm still facing the same error. I added the jdk bin path to environmental variables and also made sure that my terminals directory is same. I never needed to compile the java class before since VS code's simple run button worked well but this time I compiled it and ran it again, but same error. The class name is correct as well. Also, some previous files are running just fine but since yesterday every new file is giving the main class not found error.

here's the error:
Error: Could not find or load main class LearningFunctions.palendrome
Caused by: LearningFunctions.palendrome

shrutichoudhary
Автор

Hi Sir, I'm still facing the same error. I added the jdk bin path to environmental variables and also made sure that my terminals directory is same. I I compiled it and ran it again, but same error. The class name is correct as well. Also, some previous files are running just fine but since yesterday every new file is giving the main class not found error.

I have the following class name in AppiumTestDemo.java

public class AppiumTestDemo {

static WebDriver driver;


javac AppiumTestDemo.java

The term ’javac’ is not recognized as a name of a cmdlet, function, script file, or executable program.Check the spelling of the name, or if a path was included, verify that the path is correct and try again

Kumark
Автор

Well the reason I got stucked with this error is that, when I copy the code and paste it in, I change the name of the public class coding section, and then I change the name of the .java file later. It comes to me that normally, there would be a line said run debug before the psvm line. However, I didn't see it this time. I then proceed to open terminal and then type in java + class name. It turned out, the class name is a different one even when I've changed it. Thanks.

vucvtnv
Автор

Thank u somuch really help me. I was frustrated, my problem was that i didn't save the file and tried to run the really helped me sir thank u somuch...

dineshkumarbehera
Автор

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
Автор

But still the yellowish error problem is shown 😢

mrpagluu
Автор

sir please help
here is the error:-Error: Main method not found in class Main, please define the main method as:
public static void main(String[] args)
or a JavaFX application class must extend
PS C:\Users\91935\Desktop\coding era\JAVA\java code\java code>

anshumangupta