azure - VS 2017 for Mac Azure Function 无法配置 java worker。找不到 JAVA_HOME 应用设置
问题描述
我正在创建一个 Azure Function Apps 项目。运行服务器时出现以下错误。
Hosting environment: Production
Content root path:
/Users/dentonsavage/Projects/AzureFunctionTest/AzureFunctionTest/bin/Debug/netstandard2.0
Now listening on: http://localhost:7071 Application started. Press Ctrl+C to shut down.
[7/9/18 9:48:39 PM] Reading host configuration file '/Users/dentonsavage/Projects/AzureFunctionTest/AzureFunctionTest/bin/Debug/netstandard2.0/host.json'
[7/9/18 9:48:39 PM] Host configuration file read:{}
[7/9/18 9:48:39 PM] Starting Host (HostId=shoufu-1532713004, InstanceId=9869d715-4618-48f0-b0d1-16c4fea66dba, Version=2.0.11651.0, ProcessId=43170, AppDomainId=1, Debug=False, ConsecutiveErrors=0, StartupCount=1, FunctionsExtensionVersion=)
[7/9/18 9:48:40 PM] Unable to configure java worker. Could not find JAVA_HOME app setting.
[7/9/18 9:48:40 PM] Could not configure language worker Java.
[7/9/18 9:48:41 PM] Generating 1 job function(s)
[7/9/18 9:48:41 PM] Found the following functions:
[7/9/18 9:48:41 PM] AzureFunctionTest.HttpTrigger.Run
[7/9/18 9:48:41 PM] Host initialized (2120ms) Listening on
http://localhost:7071/ Hit CTRL-C to exit...
Http Functions:
HttpTrigger: http://localhost:7071/api/HttpTrigger
[7/9/18 9:48:43 PM] Host started (3920ms)
[7/9/18 9:48:43 PM] Job host started
[7/9/18 9:48:44 PM] Host lock lease acquired by instance ID '000000000000000000000000C475F100'.
有谁知道我该如何解决这个问题?谢谢你。
解决方案
其实这不是错误。这只是一个提示,提醒我们您的系统环境变量中没有JAVA_HOME
配置。
它以前用于 java 开发,但在新版本的 Azure Function 核心工具中被证明是不必要的并被删除。看到这个问题。
所以你可以忽略这个无害的提示或安装最新版本的功能核心工具来摆脱它。
安装步骤:
- 为 macOS安装.NET Core 。
- 安装Homebrew(如果尚未安装)。
使用 bash 安装核心工具包:
brew tap azure/functions brew install azure-functions-core-tools
之后导航到内容根路径:
/Users/dentonsavage/Projects/AzureFunctionTest/AzureFunctionTest/bin/Debug/netstandard2.0
然后输入func start
bash 来调试你的项目。
推荐阅读
- sql - 如何根据特定条件选择行
- tensorflow - 为什么 tf.flags 与 argparse 冲突?
- ios - 如何在 FFmpeg 命令中指定图像
- python - 如果 Pandas 列不包含同一行中另一列的值,则将另一列中的值添加到新行中
- nginx - 当路由是 PHP 文件时,页面会显示错误。未指定输入文件
- r - 每次迭代后将列的元素相乘以跳过一个元素
- python - wxPython如何在状态栏中设置小部件位置
- python - Meta Open Graph xpath选择器的Python Selenium问题
- c# - 如何获取具有特定 nuget 包作为参考的项目
- c# - 水平合并csv文件