I was encountering the 'Could not find the required version of the Java(TM) 2 Runtime Environment' error when I was trying to install JDK 64-bit on my 64-bit Windows 7 machine.
The reason for throwing such error is that JDK installer is written in Java, therefore you need to have JRE installed. I assume that this is a bug in the Java installer somewhat, because after installing JDK EE, you will have a JRE inside that as well, so you end up having two JREs.
Surprisingly, if you install JRE 64-bit and set your %JAVA_HOME% and path variables, you will still see that issue remains the same.
Solution is that you should install JRE 32-bit instead of 64 bit version of JRE. If you install it, then you can install JDK EE or/and Glassfish via the installer. This might sound strange but it is true!