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
feature request: select java runtime in vs code settings #1684
The current state of Java runtime support seems to be:
this extension needs Java 11
you can specify available runtimes in java.configuration.runtimes
however you can't specify/force which of these versions to use in a project; instead there's some auto detection that looks into eclipse/maven/gradle config
As we see in #1543 a lot of people are not happy with this situation. Me neither. Please add runtime selection in VS Code settings, so that one can force the usage of e.g. JavaSE-1.8 per workspace or even per directory.
I just opened #1687 which is somewhat related to this problem - as soon as you have an "invisible" project you won't have any option to edit the underlying project settings and auto-detection may or may not work depending on the situation. Maybe it should be possible to change an invisible project to a standard eclipse project and add a UI for the most basic settings (e.g. Java runtime used)?
I'm still dealing with this issue as well. I'm on a restricted machine so I can't change my environment variables but I have a java.configuration.rutimes array with both Java 11 and the JDK that I need for my project and when I open "Configure Java Runtime" I only see that one. So then I add a java.home to my project settings and Java 11 disappears and the plugin breaks with the "Java 11 or more recent is required to run..." error.
I also posted this in issue #1543 and I figured since this is what I'm dealing with I would post it here too.
Basically the java.home needs to point to java 11 and then in your java.configuration.runtimes array need to ONLY have the runtime you want your project to be in. This is annoying because you can't put the java.configuration.runtimes array in your projects settings.json, only in your machine/remote machine's settings.json
Activity
bagrupe commentedon Oct 30, 2020
I just opened #1687 which is somewhat related to this problem - as soon as you have an "invisible" project you won't have any option to edit the underlying project settings and auto-detection may or may not work depending on the situation. Maybe it should be possible to change an invisible project to a standard eclipse project and add a UI for the most basic settings (e.g. Java runtime used)?
jjoker0110 commentedon Nov 4, 2020
I'm still dealing with this issue as well. I'm on a restricted machine so I can't change my environment variables but I have a java.configuration.rutimes array with both Java 11 and the JDK that I need for my project and when I open "Configure Java Runtime" I only see that one. So then I add a java.home to my project settings and Java 11 disappears and the plugin breaks with the "Java 11 or more recent is required to run..." error.
I also posted this in issue #1543 and I figured since this is what I'm dealing with I would post it here too.
jjoker0110 commentedon Nov 4, 2020
Just found a working solution: https://devblogs.microsoft.com/java/about-upgrading-to-java-11-for-vs-code-for-java
Basically the java.home needs to point to java 11 and then in your java.configuration.runtimes array need to ONLY have the runtime you want your project to be in. This is annoying because you can't put the java.configuration.runtimes array in your projects settings.json, only in your machine/remote machine's settings.json
Hope this helps
testforstephen commentedon Dec 18, 2020
When you use the latest "Java: Configure Java Runtime" command, you can also configure Project JDKs and Java Tooling JDK as well.