You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
JAVA_Home should be right but still shows "Note Java 8 can still be used in your own projects" #664
I think my Java setup in my Visual Studio Code should be right. But this extension still show me this:
Spring Tools Language Server requires Java 11 or higher to be launched. Current Java /usr/lib/jvm/java-8-openjdk-amd64/bin/java. (Note Java 8 can still be used in your own projects. Java 11 is only required to launch the Spring Tools Language Server process)
Source: Spring Boot Tools (Extension)
The error message that you mentioned above looks like the Spring Boot Tools extension is picking up a JDK8 to run the language server process (a tooling-internal process, not related to your projects), but it needs JDK11. I don't exactly know why the JDK8 is selected instead of the JDK11 that you have in your JAVA_HOME environment variable... :-(
In case this problem persists, you can specify which JDK the Spring Boot tools should use internally (again, just internally, not for your project) via the settings:
@martinlippert I think STS4 can read "java.home" user setting by default if it's been defined. So that I don't have to setup "spring-boot.ls.java.home" to a JDK path manually.
@martinlippert I think STS4 can read "java.home" user setting by default if it's been defined. So that I don't have to setup "spring-boot.ls.java.home" to a JDK path manually.
Agree, exactly what @BoykoAlex is already implementing at the moment... :-)
This is covered by the latest changes, I think, which is looking at the STS4 specific property first and tries java.home next, if the STS4 property is not set or not set to an existing JDK.
Activity
doggy8088 commentedon Aug 8, 2021
It seems I have to restart VS Code Server on Host.
martinlippert commentedon Aug 9, 2021
The error message that you mentioned above looks like the Spring Boot Tools extension is picking up a JDK8 to run the language server process (a tooling-internal process, not related to your projects), but it needs JDK11. I don't exactly know why the JDK8 is selected instead of the JDK11 that you have in your JAVA_HOME environment variable... :-(
In case this problem persists, you can specify which JDK the Spring Boot tools should use internally (again, just internally, not for your project) via the settings:
"spring-boot.ls.java.home": "/usr/lib/jvm/java-11-openjdk-amd64/bin/java"(or whatever the right path to the Java executable of your JDK11 install is)
doggy8088 commentedon Aug 9, 2021
@martinlippert
I finally found a way to reproduce the problem.
VSCode User Settings
{ "java.home": "/usr/lib/jvm/java-11-openjdk-amd64", "java.debug.settings.hotCodeReplace": "auto", "java.configuration.runtimes": [ { "name": "JavaSE-1.8", "path": "/usr/lib/jvm/java-8-openjdk-amd64/", "sources": "/usr/lib/jvm/java-8-openjdk-amd64/src.zip", "default": true }, { "name": "JavaSE-11", "path": "/usr/lib/jvm/java-11-openjdk-amd64", "sources": "/usr/lib/jvm/java-11-openjdk-amd64/lib/src.zip", "javadoc": "https://docs.oracle.com/en/java/javase/11/docs/api" } ] }My
JAVA_HOMEenvironment variableMy Spring Boot project created using Java 11.
I added
"spring-boot.ls.java.home": "/usr/lib/jvm/java-11-openjdk-amd64/bin/java"to mysettings.json. Kill my VS Code Host. The error still exists.doggy8088 commentedon Aug 9, 2021
@martinlippert
I found a way to workaround this problem.
doggy8088 commentedon Aug 9, 2021
@martinlippert
I think this might works. I tested without any error:
doggy8088 commentedon Aug 11, 2021
@martinlippert I think STS4 can read
"java.home"user setting by default if it's been defined. So that I don't have to setup"spring-boot.ls.java.home"to a JDK path manually.martinlippert commentedon Aug 11, 2021
Agree, exactly what @BoykoAlex is already implementing at the moment... :-)
martinlippert commentedon Aug 16, 2021
This is covered by the latest changes, I think, which is looking at the STS4 specific property first and tries
java.homenext, if the STS4 property is not set or not set to an existing JDK.