Open ole1986 opened 1 year ago
Could you pls share a sample project to reproduce the issue?
Must have something to do with multi module projects, since the parent one does not seem to recognize the java version as shown in the screenshot
<properties>
<java.version>17</java.version>
[...]
</properties>
I assume it is not necessary to include the java.version
property in every child module using <parent>(...)</parent>
declaration in its child.
Another workaround is exactly this, adding <java.version>17</java.version>
to all child modules which is IMO a bad idea
All projects i am working with are now affected and can no longer be debugged with this extension
I tried with https://github.com/spring-guides/gs-multi-module/tree/main/initial, where I moved "java.version"
property from child pom.xml to parent pom.xml, it still worked. All child modules were recognized as version 17. Could you share a sample project in github for us to reproduce it?
Unfortunately a cannot quickly provide you an example project.
Another workaround is to configure java.configuration.runtimes
as follow
"java.configuration.runtimes": [
{
"name": "JavaSE-17",
"path": "/usr/lib/jvm/java-17-amazon-corretto",
"default": true
}
],
After this I could still see in the footer that the wrong path is being used (my old /usr/lib/jvm/openjdk-11-(...)
)
So I completely removed the old openjdk JVM. Finally debugging worked again. BUT STILL JavaSE-11 is visualized with the "new" amazon-coretto-17
How do I fix the "Language Level" property?
BTW Even after the java-jdk-17 is being pulled, still shows Java 11 in the "Runtime for Projects" while every parent *.pom has java.version 17 defined
The Java language server reads the language level from your pom.xml. It appears that there is an issue when importing your Maven projects, but it is difficult to determine the root cause from just a few screenshots.
I can provide you with the pom.xml contents
Frontend module: (mostly javascript) Backend Module: (java part)
Wrong Java runtime used
Environment
Steps To Reproduce
No special launch.json
Java Configure Runtime for Projects outputs wrong java version
Should be 17 (works on other enviroments - E.g. eclipse)
Current Result
Expected Result
Debugger should simply run
Additional Informations
Workaround: mvn spring-boot:run does work