Install4j Java minimum version seems not functional

拥有回忆 提交于 2020-07-18 10:42:11

问题


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?


回答1:


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.




回答2:


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.



来源:https://stackoverflow.com/questions/57511024/install4j-java-minimum-version-seems-not-functional

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!