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.

Project does not build due to build path being incomplete

See original GitHub issue

None of my Java projects are being built properly by the language server.

All my projects are failing, even previously working projects

Fundamentally, I’m getting JRE errors such as The type java.lang.Object cannot be resolved. It is indirectly referenced from required .class files.

I’m unable to open standalone Java files, vanilla Java projects and packages, or Maven projects properly.

Here are some things I’ve tried:

  • Cleaned and restarted the language server workspace multiple times.
  • Set up the runtimes properly according to the guide.
  • Set JAVA_HOME, java.home to jEnv symlinks .jenv/versions/14.0 and directly to the JDK installations themselves /usr/local/Cellar/openjdk/14.0.1/.
  • Repeated the above steps with Java 11 and Java 14.
  • Repeated the above steps with Java 11 Homebrew Cask installation of OpenJDK /Library/Java/JavaVirtualMachines/...
  • Full wipe of VSCode and reinstalled everything, with the same results.
Additional Informations

I’m using jenv to manage my JDKs, and I’ve enabled the export and maven plugins. Compilation with javac and running with java works just fine.

Environment
  • Operating System: macOS 10.15.6
  • JDK version: 11.0.8, 14.0.1
  • Visual Studio Code version: 1.48.2
  • Java extension version: 0.65.0
Steps To Reproduce
  1. Open a new .java file and define a class.
Log files

redhat.java/client.log.2020-08-26 client.log

Current Result

Plugin is unable to find JRE classes which causes compilation errors for the server.

Expected Result

Plugin should be able to link to JRE classes and compile properly, providing Intellisense without any errors.

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:4
  • Comments:16 (2 by maintainers)

github_iconTop GitHub Comments

35reactions
marcelweiglecommented, Jan 15, 2021

In VSCode open Command Palette: Java: Clean Java Language Server Workspace -> then restart VSCode fixed this issue for me

4reactions
snjezacommented, Aug 26, 2020

@bryanmylee Could you try the following:

  • stop VS Code
  • run
rm -rf "/Users/bryan/Library/Application Support/Code/User/globalStorage/redhat.java"
rm -rf "/Users/bryan/Library/Application Support/Code/User/workspaceStorage"
  • start VS Code
Read more comments on GitHub >

github_iconTop Results From Across the Web

The project was not built since its build path is incomplete
To solve it, first re-select Android API version (set to another one and valid, then restore the on you want and validate it...
Read more >
the project was not built since its build path is incomplete vscode
Try this: Right click on the project name --> Open Properties --> Java Build Path --> Add Jars This opens and small window...
Read more >
The project was not built since its build path is ... - Eclipse
Right click-->Properties-->Build path-->Removed the library and then selected the workspace default library--->cleaned and built the project.
Read more >
Build path is incomplete. Cannot find the class file for java.lang
Also, the build path UI should give you clues what's broken. Right-click on your project and select Build Path > Configure Build Path......
Read more >
An error is occurring,it says :the project was not built since its ...
An error is occurring,it says :the project was not built since its build path is incomplete. ... Xooper TBH, I did not encounter...
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