Search code examples
javadaml

Facing issue while running Daml scenarios


Recently installed Daml SDK v: 1.18.0 for Windows following all the steps given on [https://docs.daml.com/getting-started/installation.html][1] I have even set the environment variables as required. When I run daml build I'm able to create .dar successfully but while running the scenario in VS Code's output section getting an error:

2022-01-07 05:22:59.01 [INFO] [LanguageServer] Flushed 0 logs damlc: ScenarioServiceException "Failed to run java: C:\Program Files\AdoptOpenJDK\jdk-11.0.13.8-hotspot\bin;C:\Program Files\AdoptOpenJDK\jdk-11.0.13.8-hotspot;C:\Program Files\Java\jre1.8.0_311\bin;C:\Program Files\Java\jre1.8.0_311;C:\Program Files\AdoptOpenJDK\jdk-11.0.13.8-hotspot\bin\;C:\Program Files\AdoptOpenJDK\jdk-11.0.13.8-hotspot\;C:\Program Files\Java\jre1.8.0_311\bin\;C:\Program Files\Java\jre1.8.0_311\;\bin\java: readCreateProcessWithExitCode: does not exist (No such file or directory)" [Error - 10:52:59 am] Connection to server got closed. Server will not be restarted.

I have checked the environment variables and the path, both are correct but still unable to get the scenarios running and getting this error.


Solution

  • It looks like you set JAVA_HOME but you set it to multiple paths separate by ;. Instead JAVA_HOME should only contain a single path to the JDK installation you want to use. So in your example, assuming you want to use JDK 11, set it to C:\Program Files\AdoptOpenJDK\jdk-11.0.13.8-hotspot.

    You can take a look at https://confluence.atlassian.com/doc/setting-the-java_home-variable-in-windows-8895.html for example to see how you can change it.