How do I persuade Windows to use the JDK instead of a JRE?
This question has been asked before, here and elsewhere:
How do I set the default Java installatio
On Windows, the java executable uses the Windows Registry to locate the default version of Java to run.
The copy of java.exe to run is found by using the PATH environment variable. Unless you take steps to change this, by default a copy will be found in the Windows directory. Since this copy isn't in a Java runtime directory, it locates one by looking at the registry.
So, you either need to modify the registry, or put the version of Java you want before the Windows directory in your PATH.