Exception in Install4j when creating an 32 bit Installer with bundled JRE

Viewed 57

Using Apache ANT I create a JRE bundle of a 32 bit JRE 1.8.202 using createbundle.exe:

<property name="CREATEBUNDLE" value="${install4j.path}/bin/createbundle.exe" />

<exec executable="${CREATEBUNDLE}">
<arg value="-o" />
<arg value="${install4jJREBundleDir}/${CURRENT_JRE_NAME}/" />
<!-- input -->
<arg value="${unzippedJREDirectory}/${JREDirName}/" />
</exec>

<!-- Get filename of created JRE Bundle -->
<fileset id="contents" dir="${install4jJREBundleDir}/${CURRENT_JRE_NAME}/" includes="*.tar.gz" />

<pathconvert property="INSTALL4J_JREBUNDLE" refid="contents" />

Using this bundle I try to create a 32 bit installer for my application:

<target name="installer.internal">
<install4j projectfile="${i4jprojectfile}" verbose="true" mediatypes="${i4jmediatypes}" destination="${dist}" >
<vmParameter value="-Dinstall4j.timestampUrl=${INSTALL4J_TIMESTAMP_URL}"/>
<variable name="BUILD_VERSION" value="${BUILD_VERSION}" />
<variable name="SOFTWARE_VERSION" value="${SOFTWARE_VERSION}" />
<variable name="PLATFORM_DETAIL_STRING" value="${PLATFORM_DETAIL_STRING}" />
<variable name="INSTALL4J_JREBUNDLE" value="${INSTALL4J_JREBUNDLE}" />
</install4j>
</target>

The following error is thrown when creating the installer:

350 [install4j] com.exe4j.a.d: Cannot bundle a 64-bit JRE with a 32-bit media file.
351 [install4j] at com.install4j.b.g.g.a(ejt:97)
352 [install4j] at com.install4j.b.b.a(ejt:175)
353 [install4j] at com.install4j.b.i$a.c(ejt:846)
354 [install4j] at com.install4j.b.i$a.b(ejt:837)
355 [install4j] at com.install4j.b.i.b(ejt:163)
356 [install4j] at com.install4j.Install4JApplication.c(ejt:479)
357 [install4j] at com.exe4j.a.a(ejt:342)
358 [install4j] at com.install4j.Install4JApplication.main(ejt:94)
359 [install4j] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
360 [install4j] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
361 [install4j] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
362 [install4j] at java.lang.reflect.Method.invoke(Unknown Source)
363 [install4j] at com.exe4j.runtime.LauncherEngine.launch(LauncherEngine.java:85)
364 [install4j] at com.exe4j.runtime.WinLauncher.main(WinLauncher.java:94)
365 [install4j] at com.install4j.runtime.launcher.WinLauncher.main(WinLauncher.java:25)
    366 [install4j] install4j: compilation failed. Reason: Cannot bundle a 64-bit JRE with a 32-bit media file.

The JRE in the bundle is 32 bit, so the error doesn't really make sense.

Edit: I tried using install4j v7.0.18 and Install4j8.

1 Answers

The architecture is determined from the absolute path of the bundle file. Our bundle file resides in a folder called 'c:\src\Windows10_x64...' Because of the 'x64' in the path ('Windows10_x64') Install4j thought the bundle is 64 bit.

Edit: The solution was to use a relative path for the bundle file omitting the 'Windows10_x64' folder.

Related