I have following problem. I installed new OpenJDK 17:
c:\java\jdk-17.0.2
I've set up JAVA_HOME to it and added to path:
JAVA_HOME\bin
in cmd when I type java -version it works. But when I run it from VS code or powershell it says following:
Error: could not open C:\java\jdk-17.0.2\lib\jvm.cfg'
Has anybody faced similar issue?
Thanks, M.
UPDATE #1:
here are my env variable settings:

path:


Here are 5 steps you can follow to fix the issue:
sysdm.cplfollowed by a semi-colon
;Do the following and check again with a new PowerShell prompt
5.1. Add a
JAVA_HOMEvariable equal to something like:C:\Java\JDK-17.0.25.2. Add
%JAVA_HOME%\binto the beginning of your PATH variable.