question

BingSun-0862 avatar image
0 Votes"
BingSun-0862 asked PramodValavala-MSFT commented

Azure Java Function run failed with System.Private.CoreLib: Exception while executing function: Microsoft.Azure.WebJobs.Script: Did not find any initialized language workers.

A sample http trigger java azure function local run failed with the following error:

System.Private.CoreLib: Exception while executing function: Functions.xxx. Microsoft.Azure.WebJobs.Script: Did not find any initialized language workers.

Here is my local.settings.json:

 {
   "IsEncrypted": false,
      
   "Values": {
     "AzureWebJobsStorage": "",
     "FUNCTIONS_WORKER_RUNTIME": "java"
   }
    
 }


azure-functions
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

@BingSun-0862 Could you share more details like the logs when running your function app, the OS you are running on, and development editor/IDE being used?

0 Votes 0 ·

1 Answer

BingSun-0862 avatar image
0 Votes"
BingSun-0862 answered PramodValavala-MSFT commented

i have resolved this problem already.
Cause of the problem and Solution:
Path to Java for language worker java is set in configuration file worker.config.json in the installation directory azure-function-core-tools@3/%version/workers/java

Exact location of worker.config.json file in mac /usr/local/Cellar/azure-functions-core-tools@3/<version>/workers/java.

You need to change defaultExecutablePath from "%JAVA_HOME%/bin/java to the absolute path of your java executable

· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

@BingSun-0862 Glad you were able to solve your problem! Also, you could simply set JAVA_HOME in your environment instead of updating this value directly.

0 Votes 0 ·