...
The JDK variables are defined when the JDK is found, the JRE variables are defined when the JRE is found but the JDK is not found.
The _x64 variables point to 64-bit java only; the variables without the _x64 suffix may points point to both 32-bit or 64-bit installations but 32-bit ones are preferred.
If several installations with the same major version and the same bitness but different minor version/update are found, the latest one is selected.
...