I have an application and an installer for this application, both written in Java.
During the installation process the user has to define the path of that Java's Home he later wants to use for the application runtime. This could be another JRE than the one which my installer currently run and also doesn't necessarily have to be the JAVA_HOME path.
So, to get the version of the user defined target Java where the actual application should run, I cannot simply call System.getProperty("java.runtime.version") in my installer code because this give me the version of JRE currently running the installer.
Is there any common way to programmatically get the Java version of a JRE when I only have the path to that JRE? Maybe with a separate class loader? Or with reading any META-INF or reading any class within that JRE lib?

ProcessBuilderand run that java process with-versionthen parse the output...