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
URGENT- "Java 11 or more recent is required to run. Please download and install a recent JDK" #1543
I don't understand why today I'm getting this error. Managed to temporarily solve this by downgrading Language Support for Java(TM) by Red Hat to 0.64.1.
Environment
Operating System: Windows_NT x64 10.0.20161 (remote ssh to ubuntu 18)
NO you don't! Well you should, be we're not here to judge. It is still possible to compile/run Java applications from Java 1.5 to 14, provided the proper java.configuration.runtimes are configured in the user's settings.json.
Even without setting java.configuration.runtimes, if you only have JDK 11 (or more recent) configured to run vscode-java, provided your project define compilation source/target, nothing will change
@shanewaz-abbas What are the steps you took to downgrade to 0.64.1? My company and most are reliant on Java 8, not 11 so this change is messing a lot of programmers up.
Hey @seanGammage it seems like you can point to jdk 11 and it wouldn't impact running the project, though I haven't tried it as I am busy at the moment, and the downgrade was sufficient for me. To downgrade, you just have to go the java extension page and install another version and then reload.
Reacted by MrFantiVideo, palinchen, Suyash Misra, Edmund Ham, Ricky Brent, PresenceMix, Tubeman, The, Roger Ramos Paredes, KaKinWong, AriBerger and 9 more
Reacted by PresenceMix, Everton Trindade, StephaniePereyra and Jun Lee
I noticed the new version tries to detect the language version used by the project (JavaSE-1.5) - how do I manage these? Any config? All these projects are not Maven/Gradle but are old Eclipse projects using IVY, so I can't just go ahead and modify them mindlessly. What I found out that there were some old Eclipse extension-settings stored with source-level set to 1.5 - I adjusted them to 1.8 (like the projects now require). But in the status bar there was still the JavaSE-1.8 mentioned ... in the old version everything worked in that regard, there weren't any issues with the projects.
For now I also downgraded, until I get to understand how the runtime-configs work and how I can assign them to my Eclipse legacy-projects. I tried to config it like this:
@thiscantbeserious Basically, the setting java.configuration.runtimes won't change the language level of your project (except for the standalone files). This setting is used to tell the language server where different versions of the JDK are installed. The language server will pick up the matchest one according to your project's configuration.
Would you mind to share the content of this file .settings/org.eclipse.jdt.core.prefs
That's the file(s) that previously had source-level set to 1.5 - I've adjusted these for the other projects and it happened to work fine judging from the code-completion for example with lambdas. From my quick test the new version didn't happen to catch it up in the status-bar ... I can't update to the new version right now since I need to finish a task but I'll try it later and will report back if there's any issues or if it was just a hiccup. Indeed I'm using the above config running the extension with OpenJDK 11 for now ... and it seems to work fine on 0.64.1, so at least that shouldn't be a blocker for me.
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.
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
Reacted by shanewaz-abbas, Jan Holcak and Fandi Akhmad
@atg22896: If you are using a gradle version below 4.7 the "workaround" is to stick with vscode-java v0.64.1 until you are able to update the gradle version.
@atg22896: If you are using a gradle version below 4.7 the "workaround" is to stick with vscode-java v0.64.1 until you are able to update the gradle version.
So always use 0.64.1, got it. 😄 Sadly all my work projects use Gradle 2.X and it's not like I can make the whole company use an updated Gradle.
If you are like me and don't like to upgrade java version just to keep using the extension this is a simple trick you can do. Go to extensions, settings then install version 0.64.1 which still works fine with java8
Does your VSCODE also display this interface every time you start it?
@v-arc The latest Language Support for Java has embedded a JDK to launch itself, so there is no need to download another JDK11 to launch it. Please try the latest one and see if it works.
@v-arc The latest Language Support for Java has embedded a JDK to launch itself, so there is no need to download another JDK11 to launch it. Please try the latest one and see if it works.
How about gradle support ?
Do I need to update my projects gradle ?
Because I need to stick with Gradle 4.0.2.
@jdneo seems find even without setting java.import.gradle.java.home. I've removed every generated files and folders and additionally cleared Java Language Server Workspace to make sure that I don't ran into problems opening fresh projects in the future.
On Linux, flatpacked vscode doesn't have access to the local JDK for instance.
That was the culprit for me. The weird part thing is that, even when i host file system access to VScode, the application still couldn't access the root directory. I had to reinstall it using the prepackaged deb
Activity
fbricon commentedon Jul 22, 2020
As the message states, JDK 11 is now required to run the vscode-java extension. See https://github.com/redhat-developer/vscode-java/wiki/JDK-Requirements for more details.
Warnings about this change have been displayed since mid-April (https://github.com/redhat-developer/vscode-java/blob/master/CHANGELOG.md#0600-april-16th-2020)
fbricon commentedon Jul 22, 2020
@akaroml @jdneo @testforstephen @Eskibear can you make sure the Java extension pack JDK requirements align with vscode-java?
shanewaz-abbas commentedon Jul 22, 2020
So I can still run my project without making changes, I just have to use jdk 11? Or did I misunderstand?
fbricon commentedon Jul 22, 2020
Wiki page says it all:
fbricon commentedon Jul 22, 2020
Even without setting
java.configuration.runtimes, if you only have JDK 11 (or more recent) configured to run vscode-java, provided your project define compilation source/target, nothing will changeseanGammage commentedon Jul 22, 2020
@shanewaz-abbas What are the steps you took to downgrade to 0.64.1? My company and most are reliant on Java 8, not 11 so this change is messing a lot of programmers up.
fbricon commentedon Jul 22, 2020
@seanGammage you can still compile your projects with Java 8. JDK11 is only required to run vscode-java. See https://github.com/redhat-developer/vscode-java/wiki/JDK-Requirements for more details
shanewaz-abbas commentedon Jul 22, 2020
Hey @seanGammage it seems like you can point to jdk 11 and it wouldn't impact running the project, though I haven't tried it as I am busy at the moment, and the downgrade was sufficient for me. To downgrade, you just have to go the java extension page and install another version and then reload.
seanGammage commentedon Jul 22, 2020
Awesome, thank you! @fbricon and @shanewaz-abbas
thiscantbeserious commentedon Jul 23, 2020
I noticed the new version tries to detect the language version used by the project (JavaSE-1.5) - how do I manage these? Any config? All these projects are not Maven/Gradle but are old Eclipse projects using IVY, so I can't just go ahead and modify them mindlessly. What I found out that there were some old Eclipse extension-settings stored with source-level set to 1.5 - I adjusted them to 1.8 (like the projects now require). But in the status bar there was still the JavaSE-1.8 mentioned ... in the old version everything worked in that regard, there weren't any issues with the projects.
For now I also downgraded, until I get to understand how the runtime-configs work and how I can assign them to my Eclipse legacy-projects. I tried to config it like this:
A bit off-topic but while we're at it: The Eclipse-Importer seems to ignore the "java.import.exclusions" config completely.
jdneo commentedon Jul 23, 2020
@thiscantbeserious Basically, the setting
java.configuration.runtimeswon't change the language level of your project (except for the standalone files). This setting is used to tell the language server where different versions of the JDK are installed. The language server will pick up the matchest one according to your project's configuration.Would you mind to share the content of this file
.settings/org.eclipse.jdt.core.prefsthiscantbeserious commentedon Jul 23, 2020
That's the file(s) that previously had source-level set to 1.5 - I've adjusted these for the other projects and it happened to work fine judging from the code-completion for example with lambdas. From my quick test the new version didn't happen to catch it up in the status-bar ... I can't update to the new version right now since I need to finish a task but I'll try it later and will report back if there's any issues or if it was just a hiccup. Indeed I'm using the above config running the extension with OpenJDK 11 for now ... and it seems to work fine on 0.64.1, so at least that shouldn't be a blocker for me.
26 remaining items
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.
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
plachta11b commentedon Nov 14, 2020
@jjoker0110 thanks. That helped to solve my problem.
I have got path bellow by running
echo $JAVA_HOMEin the openjdk:11 container.Setting java.home in my devcontainer.json was probably enough to make it run.
I installed gradle too. I do not know if I had to.
DoNotResuscitate commentedon Jan 18, 2021
So there is still no solution for using older Gradle versions?
Bno93 commentedon Jan 19, 2021
@atg22896: If you are using a gradle version below 4.7 the "workaround" is to stick with vscode-java v0.64.1 until you are able to update the gradle version.
DoNotResuscitate commentedon Jan 22, 2021
So always use 0.64.1, got it. 😄 Sadly all my work projects use Gradle 2.X and it's not like I can make the whole company use an updated Gradle.
H3nryM4 commentedon Dec 29, 2021
Does your VSCODE also display this interface every time you start it?

jdneo commentedon Jan 4, 2022
@v-arc The latest
Language Support for Javahas embedded a JDK to launch itself, so there is no need to download another JDK11 to launch it. Please try the latest one and see if it works.H3nryM4 commentedon Jan 4, 2022
@jdneo Great! I just upgraded
Language Support for Javato version v1.2.0 and it worked without warning. Thanks!Bno93 commentedon Jan 4, 2022
How about gradle support ?
Do I need to update my projects gradle ?
Because I need to stick with Gradle 4.0.2.
jdneo commentedon Jan 5, 2022
@Bno93
I think you can try to set the setting
java.import.gradle.java.home, use it to point to your own JDK which is compatible with Gradle 4.0.2Bno93 commentedon Jan 7, 2022
@jdneo seems find even without setting
java.import.gradle.java.home. I've removed every generated files and folders and additionally cleared Java Language Server Workspace to make sure that I don't ran into problems opening fresh projects in the future.jdneo commentedon Feb 8, 2022
@testforstephen @rgrunber @fbricon We can consider to unpin this issue since we have embedded jre now
kqvanity commentedon Jul 2, 2022
That was the culprit for me. The weird part thing is that, even when i host file system access to VScode, the application still couldn't access the root directory. I had to reinstall it using the prepackaged deb