skip to Main Content

Why do I keep getting this error in VS Code when I try to run a Java file ‘boolean org.eclipse.jdt.internal.core.SourceMethod.isMainMethodCandidate()’

I already tried to change the path, updated the extension for java but I still received the same error

2

Answers


  1. Your problem should be due to not being able to find the entry main method. You can check there whether have an effective main method in your Java class, like public static void main(String[] args). Use the command Java:Conigure Java Runtime to see the jdk version whether is your own version. You can clean the workspace cache with the Java:Clean the Java Language Server Workspace command.

    Login or Signup to reply.
  2. I fixed it by installing a lower version of "Debugger for Java" extension and its steps are:

    1. Open extensions on VS Code
    2. Search "Debugger for Java"
    3. Click on dropdown arrow showing with Uninstall button
    4. Then click on Install Another Version…
    5. Choose a lower version (in my case current version was 0.58.0 but fixed with 0.56.2)
    6. Finally, click on Reload Required button

    enter image description here

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search