"Classpath is incomplete" warning with Maven project
See original GitHub issueI get the “Classpath is incomplete” popup warning, but can’t seem to figure out the magic combination of rain dances required to make it “work”.
Environment
- Operating System: Mac OS 10.13.6
- JDK version: 1.8.0_144
- Visual Studio Code version: 1.27.2
- Java extension version: 0.3.0
Steps To Reproduce
- Create a blank maven project in an empty folder using the context menu “Generate from Maven Archetype”
- Open the generated
App.java
Sample project attached threadtest.zip
The only relevant log entry in server log is:
!ENTRY org.eclipse.jdt.ls.core 1 0 2018-09-27 11:53:20.416
!MESSAGE Classpath is incomplete. Only syntax errors will be reported for file:///<REDACTED>/threadtest/src/main/java/threadtest/App.java
Current Result
VS Code pops up the “Classpath is incomplete” warning
Expected Result
Based on the suggestions here, I expected to not get this warning. It’s worth noting however, that the language on this page is a little confusing. Particularly this:
Whenever a java file is opened, that does not belong to a project
VS Code doesn’t have a concept of a “project”. Are you talking about a Maven project? Folks new to either VS Code or your extension (like me) might be confused by what this means (in-fact I am still confused, because I think I have a project but presumably I don’t)
Issue Analytics
- State:
- Created 5 years ago
- Comments:11 (1 by maintainers)
Hmm ok… maybe we can use this as a way to incrementally improve these docs 😃
Following the “clean up the workspace directory” link, there is no actual mention of deleting anything, I guess I’m supposed to delete a directory?
Need to work out which folder, ah this is what I need…
OK… what is
vscode-java logs
?.. let me look at the rest of this doc…Sweet… ok, it says:
Well… it didn’t fail, but let me open the chrome console anyway. …
Hmm… ok I don’t see the same thing… let’s just restart vscode. No dice.
I don’t have a
.project
nor a.classpath
. Do I need to create these manually?I just want to share what I found when opening typescript-generator in VS Code.
This repo is basically Maven project with sub-modules but it also contains some Gradle sample modules. When I disable
java.import.gradle.enabled
configuration setting Maven modules work well. It seems that Maven and Gradle support somehow conflicts here. It is not optimal but at least there is some way to make it work. Thanks