See also my related question.
Our Java application runs with Java 1.6 and higher, but we prefer 1.7 (because of certain additional features). When launching it how can I detect whether JRE 1.7 is installed and use an installed JRE 1.6 only as a fall-back? From the symlink-chain starting at
which java it looks like the user only can decide for either Java 1.6 or 1.7.