Damlc: ScenarioServiceException

Hello, I’m learning daml and whenever i’m trying to run a scenario, I get this error. Previously I have ran scenarios but now I’m having a problem since it gives me this error:

damlc: ScenarioServiceException “Failed to run java: C\Users\name\Downloads\bin\java: readCreateProcessWithExitCode: does not exist (No such file or directort)”

I have checked on both of my computers and it gives the same error. I’m running it on VS Code and it gives me “connection to sever got closed. Server will not be restarted.” I have set JAVA_PATH into my system and environment PATH. Not sure what is the problem?

1 Like

Hi @PoorJew and welcome to the forum,

Java needs to either be in JAVA_HOME or in PATH and that environment variable needs to be visible to VSCode. JAVA_PATH does not matter here. I’d suggest the following steps:

  1. Run echo $env:PATH and echo $env:JAVA_HOME and share the output here. Once those are correct move on to the next step.
  2. Close VSCode completely and run daml studio from powershell after you verified that the environment variables are set correctly.
1 Like

Hello, thank you for you reply. I didn’t mean JAVA_PATH but JAVA_HOME, apologies.

I run these on my windows PC:

echo %PATH%

C:\Program Files\Eclipse Adoptium\jdk-17.0.1.12-hotspot\bin;C:\Program Files (x86)\Intel\iCLS Client;C:\Program Files\Intel\iCLS Client;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\WINDOWS\System32\OpenSSH;C:\Users\Yakov\AppData\Roaming\daml\bin;C:\Users\Yakov\AppData\Local\Microsoft\WindowsApps;C:\Users\Yakov\AppData\Local\Programs\Microsoft VS Code\bin;C:\Program Files\Eclipse Adoptium\jdk-17.0.1.12-hotspot\bin\java.exe;

Then I run echo %JAVA_HOME%:

C:\Program Files\Eclipse Adoptium\jdk-17.0.1.12-hotspot\bin\java.exe

I also run where java:

C:\Program Files\Eclipse Adoptium\jdk-17.0.1.12-hotspot\bin\java.exe

This is what I’m getting:

damlc: ScenarioServiceException “Failed to run java: C:\Program Files\Eclipse Adoptium\jdk-17.0.1.12-hotspot\bin\java.exe\bin\java: readCreateProcessWithExitCode: does not exist (No such file or directory)”

[Info - 06:20:14] Connection to server got closed. Server will restart.

damlc: ScenarioServiceException “Failed to run java: C:\Program Files\Eclipse Adoptium\jdk-17.0.1.12-hotspot\bin\java.exe\bin\java: readCreateProcessWithExitCode: does not exist (No such file or directory)”

[Info - 06:20:18] Connection to server got closed. Server will restart.

damlc: ScenarioServiceException “Failed to run java: C:\Program Files\Eclipse Adoptium\jdk-17.0.1.12-hotspot\bin\java.exe\bin\java: readCreateProcessWithExitCode: does not exist (No such file or directory)”

[Info - 06:20:23] Connection to server got closed. Server will restart.

damlc: ScenarioServiceException “Failed to run java: C:\Program Files\Eclipse Adoptium\jdk-17.0.1.12-hotspot\bin\java.exe\bin\java: readCreateProcessWithExitCode: does not exist (No such file or directory)”

[Info - 06:20:25] Connection to server got closed. Server will restart.

damlc: ScenarioServiceException “Failed to run java: C:\Program Files\Eclipse Adoptium\jdk-17.0.1.12-hotspot\bin\java.exe\bin\java: readCreateProcessWithExitCode: does not exist (No such file or directory)”

[Error - 06:20:28] Connection to server got closed. Server will not be restarted.

I have tried everything at this point - reinstalling JDK, daml sdk, VS Code, Changing JAVA_HOME to a different location etc, nothing worked.

I have tried running daml from command prompt various times but it doesn’t let me.

JAVA_HOME should point to the JDK installation not the Java binary, so change it to

C:\Program Files\Eclipse Adoptium\jdk-17.0.1.12-hotspot

Thank you so much, it worked!!!