Project does not build due to build path being incomplete
See original GitHub issueNone 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
- 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:
- Created 3 years ago
- Reactions:4
- Comments:16 (2 by maintainers)
In VSCode open Command Palette: Java: Clean Java Language Server Workspace -> then restart VSCode fixed this issue for me
@bryanmylee Could you try the following: