Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio Code showing "Java 11 or more recent is required to run. Please download and install a recent JDK"

Today Visual Studio Code started showing me a pop-up saying:

Java 11 or more recent is required to run. Please download and install a recent JDK.

I need to use the JDK 8 (working on Apache Beam and that's the last supported version). I have been working on that and haven't had any issues until this came up.

I have read through this article and implemented the points mentioned there.

Here is my workspace settings on Visual Studio Code (I have double-checked the paths)

{     "java.configuration.updateBuildConfiguration": "disabled",     "java.home": "/Library/Java/JavaVirtualMachines/adoptopenjdk-8.jdk/Contents/Home",     "java.configuration.runtimes": [         {           "name": "JavaSE-1.8",           "path": "/Library/Java/JavaVirtualMachines/adoptopenjdk-8.jdk/Contents/Home",           "default": true         },         {           "name": "JavaSE-11",           "path": "/Library/Java/JavaVirtualMachines/adoptopenjdk-11.jdk/Contents/Home",         }       ] } 

Other helpful information:

➜ echo $JAVA_HOME /Library/Java/JavaVirtualMachines/adoptopenjdk-8.jdk/Contents/Home 

and

➜ which java /usr/bin/java 

This started happening today even though I have been running JDK 8 on Visual Studio Code successfully for a while now. I don't remember updating Visual Studio Code, so I'm not sure as to why this is being displayed now since apparently the pop-up has been displayed since mid-April (asked on the vscode-java Gitter channel).

like image 242
mcansado Avatar asked Jul 22 '20 21:07

mcansado


People also ask

Where is Java runtimes VS Code?

Configure your project JDK using the VS Code setting "java. configuration. runtimes" found by clicking on the "File->Preferences->Settings" menu item and searching for "java. configuration.


1 Answers

Change from

"java.home": "/Library/Java/JavaVirtualMachines/adoptopenjdk-8.jdk/Contents/Home"

to

"java.home": "/Library/Java/JavaVirtualMachines/adoptopenjdk-11.jdk/Contents/Home"

and keep the rest of the settings as is.

like image 143
Xavier Avatar answered Sep 28 '22 13:09

Xavier