Home > Enterprise >  How to specify a JDK for a project in visual studio
How to specify a JDK for a project in visual studio

Time:10-11

Hi I am using visual studio code to developp an app and to build and run the app I need JDK 1.8 so my JAVA_HOME variable is set on my jdk 1.8 but to build and run all the back end of my app I need java 1.14. So how can I configure java/visual studio code to set the folders of my back end on JDK 1.14 and folder of my front end on jdk 1.8

CodePudding user response:

Here is Documentation from visual stuio code expalining how to set up multiple JDK. Basically just use runtime Configuration wizard to configure java.configuration.runtimes for each of your JDK.

CodePudding user response:

Java extension needs JDK11 or recent version to support, and you have jdk14 installed, so it's required to set jdk14 as java.home. See Supported Java versions.

Then you can configure java runtime by adding the following settings in Settings.json or use the Java runtime configuration wizard like @OjtamOjtam suggested.

"java.home":"path-to-jdk14",
"java.configuration.runtimes": [
        {
            "name": "JavaSE-14",
            "path": "path-to-jdk14",
        }
    ]
  • Related