It would be nice if minVersion
and maxVersion
would be taken into account for bundled JREs.
This is especially important with the changes of feature-requests#127, if you specify for example %JAVA_HOME%;%PATH%
, your classes are compiled with Java 11, JAVA_HOME
points to Java <11 and PATH
contains Java >=11, or registry entries have a Java 11.
Currently the first Java found will be used which will then just silently fail as the Java classes are not compatible with Java 10.
So it would be nice if the version of "bundled" Java would be validated against minVersion
and maxVersion
and search continued if not eligible.
I get from that feature request, that you are restrained from doing so as you don't want to rely on the output of java -version
in case it changes, or maybe even the path that usually also contains the version.
But you could for example also bundle some minimalistic Java class that outputs the result of System.getProperty("java.version")
and then unpack it to a temporary location and execute it with the found JRE, then consume that result. This property should be more stable I guess.
Ticket moved from /p/launch4j/bugs/201/