Error when I want to start a local match, Troubleschooting

Whenever I try to start a local match on my Pc I get this error:

Start run a match
Error: could not open `C:\Program Files\Java\jre1.8.0_211\lib\amd64\jvm.cfg’
Finished running match

I really don’t know what to do. I tried updating java several times, change the Path and everything. When I try to use the command javac -version or java in cmd I get the same error:

Error: could not open `C:\Program Files\Java\jre1.8.0_211\lib\amd64\jvm.cfg’

I tried adding JAVA_HOME to my environment variables but that doesn’t seem to work. I heard something about %JAVA_HOME% in the beginning of path but I don’t understand what that means.

Does anyone know how to solve it?

Edit: I finally got it working after 5h.

SOLUTION:

1)Add JAVA_HOME to enviromental variables. Insert the location of your JDK file for the value:
for me it was C:\Program Files\Java\jdk-12.0.1. You must change Programm Files to this: Progra~1

In the End it should look like this: C:\Progra~1\Java\jdk-12.0.1

Weblink where I found the solution
https://confluence.atlassian.com/doc/setting-the-java_home-variable-in-windows-8895.html

2)Add the bin folder to path. For me it looked like this

C:\Program Files\Java\jdk-12.0.1\bin

  1. add another value for path and move it to the top

%JAVA_HOME%

weblink to where I found the solution

Could you share the solution you came up so I can better help anyone who has a similar issue in the future, or possibly fix it if there is an issue.

Sure, I’ll edit it