skip to Main Content

After saving/modifying the file, vscode highlighting an error importing my com.papersaccul into visual studio code
Despite the fact that gradle.build specifies the path

sourceSets {
    main {
        java {
            srcDirs = ['src/main/java']
        }
    }
}

If I switch to another window and switch back, the errors disappear.
The application works fine, built via gradle

after ctrl+s

after switch window

jetbrains doesn’t have that problem.

I think the problem is in the standard java debugger (vscjava) even though I’ve kind of configured the build through gradle in .vs

2

Answers


  1. Chosen as BEST ANSWER

    Solution: Ctrl+Shift+P --> Java: Clean Java Language Server Workspace


  2. Restart vscode after using the following command:

    Ctrl+Shift+P –> Java: Clean Java Language Server Workspace

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