close

[Solved] Could not find or load main class – VS Code

Hello Guys, How are you all? Hope You all Are Fine. Today I am facing the following error Could not find or load main class – VS Code in Java. So Here I am Explain to you all the possible solutions here.

Without wasting your time, Let’s start This Article to Solve This Error.

How Could not find or load main class – VS Code Error Occurs?

Today I am facing the following error Could not find or load main class – VS Code in Java.

How To Solve Could not find or load main class – VS Code Error ?

  1. How To Solve Could not find or load main class – VS Code Error ?

    To Solve Could not find or load main class – VS Code Error i think you install the Code Runner Extension,so you have a Run icon in the upper right-hand corner,you could try to uninstall it

  2. Could not find or load main class – VS Code

    To Solve Could not find or load main class – VS Code Error i think you install the Code Runner Extension,so you have a Run icon in the upper right-hand corner,you could try to uninstall it

Solution 1

i think you install the Code Runner Extension,so you have a Run icon in the upper right-hand corner,you could try to uninstall it,

then F1 ->Clean the java language server workspace.,run your code with F5 or the Run above your Main method

Solution 2

Try editing your .classpath file to show it where your main class is.

An easier, but much more jank method, is to move your .java file to the root of your project directory to help vscode find it.

Summery

It’s all About this issue. Hope all solution helped you a lot. Comment below Your thoughts and your queries. Also, Comment below which solution worked for you? Thank You.

Also, Read