问题
Our development environment consist of several build agents who builds the installer mediums. Today we had a compile error inside of install4j at one of the build agents. The class version didn't match with some custom classes. We found out that the installed jre on the build agent were a jre_1.6 x32 and a jre_1.7 x64. The project setting was set to create a x32 installer medium with a minimum java version of 1.7. Therefore the search algorithm of install4j (%JAVA_HOME% etc.) used the jre_1.6 x32 to compile the code.
Now the question: is it possible to configure the compile-jre during the maven build process? Maybe to modify the path of the config.xml from %User_Home%/.install4j5 to %INSTALL4J_HOME%/config?
The best solution for our environment would be to point the compile-jre to a jre, which will be extracted during the maven build (phase: process-resources) and which will be included later in the installer as the bundled jre for the application. Then we could be ensure that the application is compiled with the same jre as it will be used after installation. No matter how the build agent is configured (x64 or x32).
Hopefully the problem is understandable.
Greetings
Hardie
回答1:
On the "General Settings->Java version" step, you can configure the JDK or JRE that will be used for script compilation. By default, this is set to "Currently used JRE", i.e. the JRE that the install4j IDE and the command line compiler are running with.
To make compilation more deterministic, switch to a configured JDK. Only the specified name of the JRE (such as "JDK 1.7") will be saved in the project, the actual JRE has to be configured on each machine and is then globally the same for all projects.
If you compile on a headless machine, edit $HOME/.install4j5/config.xml
and set the jdks
element to something like
<jdks>
<jdk name="JDK 1.7" id="1" javaHome="path/to/java/home"
version="1.7.0" jreOnly="false" />
</jdks>
来源:https://stackoverflow.com/questions/18060075/how-to-configure-compile-jre-on-build-agents