# Damlc: ScenarioServiceException

**URL:** <https://forum.canton.network/t/damlc-scenarioserviceexception/3434>\
**Category:** App Development\
**Created:** [November 12, 2021, 3:38am UTC](https://forum.canton.network/t/damlc-scenarioserviceexception/3434 "2021-11-12T03:38:45Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![PoorJew](https://avatars.discourse-cdn.com/v4/letter/p/6de8d8/32.png) [@PoorJew](https://forum.canton.network/u/PoorJew)\
**Post date:** [November 12, 2021, 3:38am UTC](https://forum.canton.network/t/damlc-scenarioserviceexception/3434/1 "2021-11-12T03:38:45Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![cocreature](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/cocreature/32/36_2.png) [@cocreature](https://forum.canton.network/u/cocreature)\
**Post date:** [November 12, 2021, 6:09am UTC](https://forum.canton.network/t/damlc-scenarioserviceexception/3434/2 "2021-11-12T06:09:28Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![PoorJew](https://avatars.discourse-cdn.com/v4/letter/p/6de8d8/32.png) [@PoorJew](https://forum.canton.network/u/PoorJew)\
**Post date:** [November 12, 2021, 6:33am UTC](https://forum.canton.network/t/damlc-scenarioserviceexception/3434/3 "2021-11-12T06:33:00Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![cocreature](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/cocreature/32/36_2.png) [@cocreature](https://forum.canton.network/u/cocreature)\
**Post date:** [November 12, 2021, 6:34am UTC](https://forum.canton.network/t/damlc-scenarioserviceexception/3434/4 "2021-11-12T06:34:30Z")

</div>

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

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

```

---

<div class="post-metadata">

**Author:** ![PoorJew](https://avatars.discourse-cdn.com/v4/letter/p/6de8d8/32.png) [@PoorJew](https://forum.canton.network/u/PoorJew)\
**Post date:** [November 12, 2021, 7:08am UTC](https://forum.canton.network/t/damlc-scenarioserviceexception/3434/5 "2021-11-12T07:08:50Z")

</div>

Thank you so much, it worked!!!
