question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

"Classpath is incomplete" warning with Maven project

See original GitHub issue

I 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
  1. Create a blank maven project in an empty folder using the context menu “Generate from Maven Archetype”
  2. 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:open
  • Created 5 years ago
  • Comments:11 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
jasonpolitescommented, Sep 27, 2018

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…

Now, if you open the vscode-java logs, you’ll see something like:

OK… what is vscode-java logs?.. let me look at the rest of this doc…

Get the vscode-java logs

Sweet… ok, it says:

When the Java extension fails to start…

Well… it didn’t fail, but let me open the chrome console anyway. …

image

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?

1reaction
vojtechhabartacommented, Apr 17, 2020

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

Read more comments on GitHub >

github_iconTop Results From Across the Web

Java Classpath is incomplete. Only syntax errors will be reported
The quite easy solution I found is using MAVEN. Maven creates the whole project structure and initial configuration files in your home folder ......
Read more >
classpath is incomplete warning : r/vscode - Reddit
classpath is incomplete warning. I am trying to use VSCode to write Java code, and I would like to avoid the structure of...
Read more >
Classpath is incomplete. Only syntax errors will be reported" in ...
[Solved]-"Classpath is incomplete. Only syntax errors will be reported" in VSCode with Java Play Eclipse Project-eclipse ... Problem solved : the sbt extension...
Read more >
redhat-developer/vscode-java - Gitter
The Classpath is Incomplete warning is really nice, but it doesn't identify a location for the problem. I am a student with like...
Read more >
Maven plugin for GraalVM Native Image building
If the agent is enabled, the --allow-incomplete-classpath option is automatically added to your native build options. Running your application with the agent.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found