title: Azure Function in Java does not work locally
body: <p>I am trying to run Azure function locally on my mac with IntelliJ. I did everything, step by step in this tutorial: <a href="https://docs.microsoft.com/en-us/azure/azure-functions/functions-create-maven-intellij" rel="noreferrer">https://docs.microsoft.com/en-us/azure/azure-functions/functions-create-maven-intellij</a> but when I start the project console show me error that</p>
  <pre><code>`Azure Functions Core Tools (3.0.2912 Commit hash: bfcbbe48ed6fdacdf9b309261ecc8093df3b83f2)
  Function Runtime Version: 3.0.14287.0
  Failed to start Worker Channel. Process fileName: %JAVA_HOME%/bin/java
  System.Diagnostics.Process: No such file or directory.
  Failed to start language worker process for runtime: (null). workerId:9c6a8dfb-6dcc-4e3c-82a6-0ce0c6949991
  No job functions found. Try making your job classes and methods public. If you're using binding extensions (e.g. Azure Storage, ServiceBus, Timers, etc.) make sure you've called the registration method for the extension(s) in your startup code (e.g. builder.AddAzureStorage(), builder.AddServiceBus(), builder.AddTimers(), etc.).
  For detailed output, run func with --verbose flag.
  Hosting environment: Production
  Content root path: /Users/mariojaros/Library/Mobile Documents/com~apple~CloudDocs/azure-function-examples
  Now listening on: http://0.0.0.0:7071
  Application started. Press Ctrl+C to shut down.
  Host lock lease acquired by instance ID '00000000000000000000000086CB0170'.
  ^CApplication is shutting down...
  </code></pre>
  <p>`
  I think that problem is with language worker.</p>
  <p>JAVA_HOME:</p>
  <pre><code>which java
  /usr/bin/java
  </code></pre>
  <p>I was trying func start too and it was same result and finally I tried it with Visual studio code and the same error.</p>
  <p>Only way how I can run Azure Function locally in java is when I generate project with archetype <code>mvn archetype:generate -DarchetypeGroupId=com.microsoft.azure -DarchetypeArtifactId=azure-functions-archetype -DjavaVersion=8 </code>
  and then <code>mvn package</code> <code>mvn azurefunctions:run</code></p>
  <pre><code> [INFO] Scanning for projects...
  [INFO] 
  [INFO] ----------------------&lt; sk.devy:rendering-skuska &gt;----------------------
  [INFO] Building Azure Java Functions 1.0.0-SNAPSHOT
  [INFO] --------------------------------[ jar ]---------------------------------
  [INFO] 
  [INFO] --- azure-functions-maven-plugin:1.4.0:run (default-cli) @ rendering-skuska ---
  [WARNING] Azure Functions only support JDK 8, which is lower than local JDK version 14.0.1
  WARNING: An illegal reflective access operation has occurred
  WARNING: Illegal reflective access by com.microsoft.applicationinsights.core.dependencies.xstream.core.util.Fields (file:/Users/mariojaros/.m2/repository/com/microsoft/azure/applicationinsights-core/2.5.1-BETA/applicationinsights-core-2.5.1-BETA.jar) to field java.util.TreeMap.comparator
  WARNING: Please consider reporting this to the maintainers of com.microsoft.applicationinsights.core.dependencies.xstream.core.util.Fields
  WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
  WARNING: All illegal access operations will be denied in a future release
  [INFO] Azure Function App's staging directory found at: /Users/mariojaros/rendering-skuska/target/azure-functions/rendering-skuska-1600871852849
  [INFO] Azure Functions Core Tools found.
  Azure Functions Core Tools (3.0.2912 Commit hash: bfcbbe48ed6fdacdf9b309261ecc8093df3b83f2)
  Function Runtime Version: 3.0.14287.0
  Worker process started and initialized.
  OpenJDK 64-Bit Server VM warning: Options -Xverify:none and -noverify were deprecated in JDK 13 and will likely be removed in a future release.
  
  Functions:
  
  HttpTrigger-Java: [GET,POST] http://localhost:7071/api/HttpTrigger-Java
  
  For detailed output, run func with --verbose flag.
  Hosting environment: Production
  Content root path: /Users/mariojaros/rendering-skuska/target/azure-functions/rendering-skuska-1600871852849
  Now listening on: http://0.0.0.0:7071
  Application started. Press Ctrl+C to shut down.
  Host lock lease acquired by instance ID '000000
  </code></pre>
  <p>Has anybody relative problem ? Is func start working for java
  functions ?</p>