In my case, with Gradle and a custom configuration in the build.gradle, Clean Java Language Server Workspace did not work.
The problem was the following:
The build.gradle contained a custom configuration. By default, many IDEs (including VS Code with the Java extensions) do not automatically pick up libraries that are only declared in a custom configuration. They expect the dependencies to appear in one of the standard configurations.
How to Fix in that case: