0

Starting July Java 11 was required for Visual Studio Code. So I have installed Java 11. But Azure Function requires Java 8. I tried to configure VS to use both SDK.

Example: VSCode showing "Java 11 or more recent is required to run. Please download and install a recent JDK"

VS Code still trying to use Java 11. Is it possible to change to JDK 8??? [WARNING] Azure Functions only support JDK 8, which is lower than local JDK version 11.0.8.

JAVA_HOME env path

C:\Program Files\Zulu\zulu-11\

Settings.json for JAVA.HOME

{
  "azureFunctions.deploySubpath": "target/azure-functions/functionsjava",
  "azureFunctions.projectLanguage": "Java",
  "azureFunctions.projectRuntime": "~2",
  "debug.internalConsoleOptions": "neverOpen",
  "azureFunctions.preDeployTask": "package",
  "java.configuration.updateBuildConfiguration": "interactive",
  "azureFunctions.templateFilter": "All",
  "java.home": "C:/Program Files/Zulu/zulu-11",
  "java.configuration.runtimes": [
    {
      "name": "JavaSE-1.8",
      "path": "C:/Program Files/Zulu/zulu-8",
     "default": true
    },
    {
      "name": "JavaSE-11",
      "path": "C:/Program Files/Zulu/zulu-11",
  
    }
  ]
}
2
  • 2
    I have JAVA_HOME set to 8 and java.home in VS Code set to 11. Seems to work with Azure functions. Commented Aug 13, 2020 at 15:17
  • I face the same problem. It still try to use global settings.json. Commented Aug 14, 2020 at 3:06

1 Answer 1

1

If you want to use jdk 8, then you should do like this:

"java.home":"C:\\Program Files\\Java\\jdk1.8.0_261",

By the way, azure function support java 11, but you need you use function v3:

https://learn.microsoft.com/en-us/azure/azure-functions/functions-reference-java?tabs=consumption#supported-versions

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.