Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Install4j Java minimum version seems not functional

We are using Install4j 7.0.6 and set the Java minimum version to "10.0.1". We are bundling a Java 10.0.1 into the media file. When we replace the included JVM with a Java 9 VM our Application still starts. Are we just missunderstanding the function for the Java minimum version or are we using the wrong version format or is it broken in Install4j 7.0.6?

like image 675
Gregor G. Avatar asked Aug 15 '19 14:08

Gregor G.


2 Answers

The bundled JRE will always be used, regardless of the minimum version. The minimum applies to installed JREs that are checked by the search sequence.

like image 124
Ingo Kegel Avatar answered Sep 22 '22 02:09

Ingo Kegel


From what I can make out, the purpose of the minimum Java version parameter is to tell the Java compiler that Install4j uses to compile scripts what the Java target is level should be.

The manual includes a warning that you should not include an embedded JRE that is less than the target level because that could cause runtime errors. The implication of that warning is that Install4j doesn't check this.

Here's what the manual says:

The design time JDK is used for the following purposes:

  • Code compilation: install4j uses a bundled eclipse compiler, so it does not need this functionality from a JDK. However it needs a runtime library against which scripts entered in the installer configuration are compiled. The version of that JDK should correspond to the minimum Java version for the project. If that minimum Java version is lower than the version of the design time JDK, runtime errors can occur if you accidentally use newer classes and method.

  • ...

There probably isn't a reliable way for Install4j to check the version of the JRE you provided for embedding. At any rate, the manual implies that this is not checked.

like image 44
Stephen C Avatar answered Sep 23 '22 02:09

Stephen C