As far as i know you can use every Java version when you are just in the right directory.
Lets say i have on my PC Java 8 and Java 15. They are both located in C:\Program Files\java.
So when i go in C:\Program Files\java\jre1.8.0_291\bin and run in cmd java.exe -version i get the version 1.8 .
The same goes with Powershell.
But here comes the problem. When i go to C:\Program Files\java\jdk-15.0.1\bin i get in cmd the version 1.15, but in Powershell i still get 1.8.
I think that Powershell always refers to the standard JRE installed.
Get-Command java.exeresolve to (when you're inside thejdk-15*bin folder)?