vscode intellisense failing when 2 jdks are on system, despite env var or java.home
There seems to be a clash between vscode and multiple jdks. When having both jdk8 and jdk9, and having set JAVA_HOME to point jdk9 dir AND vscode's user setting java.home to point to jdk9 dir, intellisense fails. Compilation succeeds, can use java 9 features. Below for details.
Environment
Operating System: Win10
JDK version: 8 and 9
Visual Studio Code version: latest
Java extension version: latest
Steps To Reproduce
Have latest maven and jdk 9.0.1 installed along with jdk 8
Set env var and vscode's user setting java.home to point to jdk9 dir
Use maven's maven-compiler-plugin
element accepts , , or tags. We just use tag
When is set to 9, the whole intellisense fails. Not even java.lang.String is found
Set to 8, intellisense works again, but java 9 features are not recognized
When compiling, and doing mvn package, every time the manifest file shows that jdk8 is used, even though we have a working java 9 compiled program with java 9 features
Uninstall jdk8 from system
Now set to 9 and intellisense will work as expected and recognize java 9 features
When compiling and packaging, the manifest file will correctly show that java 9 was used