英文:
VS Code required Java 11, but Azure Functions require Java 8 - How to modify settings.json
问题
Starting July Java 11 was required for Visual Studio Code. So I have installed Java 11.
从七月开始,Visual Studio Code 需要 Java 11。所以我已安装了 Java 11。
But Azure Function requires Java 8. I tried to configure VS to use both SDK.
但 Azure Function 需要 Java 8。我尝试配置 VS 以同时使用两个 SDK。
Example: https://stackoverflow.com/questions/63043585/vscode-showing-java-11-or-more-recent-is-required-to-run-please-download-and-i
示例:https://stackoverflow.com/questions/63043585/vscode-showing-java-11-or-more-recent-is-required-to-run-please-download-and-i
VS Code still trying to use Java 11. Is it possible to change to JDK 8???
VS Code 仍然尝试使用 Java 11。是否可能更改为 JDK 8?
[WARNING] Azure Functions only support JDK 8, which is lower than local JDK version 11.0.8.
[警告] Azure Functions 仅支持 JDK 8,低于本地 JDK 版本 11.0.8。
JAVA_HOME env path
JAVA_HOME 环境变量路径
C:\Program Files\Zulu\zulu-11\
Settings.json for JAVA.HOME
JAVA.HOME 的 Settings.json 文件
{
"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"
}
]
}
英文:
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.
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",
}
]
}
答案1
得分: 1
如果您想使用jdk 8,那么您应该这样做:
"java.home":"C:\\Program Files\\Java\\jdk1.8.0_261",
顺便说一下,Azure函数支持java 11,但您需要使用v3版本的函数:
英文:
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:
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论