-
Notifications
You must be signed in to change notification settings - Fork 136
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ability to create a 32-bit native Windows installer in a 64-bit Maven build process JVM (and vice versa) #81
Comments
Found some things on the net: If I understand correctly, this should create a 32/64-bit installer depending in the selected JRE by using Its also suggested by oracle (but it was for jdk 7): https://community.oracle.com/thread/3569519 and https://community.oracle.com/thread/2455678 Maybe this helps (didnt try it myself)? |
Hi @aliebelt , i added support for multiple executions, could you retry with current master if it works for you when setting |
Hi Danny, I'm wondering how a |
Do you meen to duplicate the configuration, extract to two excecution statements and change the runtime? Something like that:
|
Yes, i had two executions in mind. |
I executed it with Maven and JDK 8u40 64bit. The 64-bit -configuration builds the native installer. When executing the 32-bit-configuration of the javafx-maven-plugin it is skipped:
This is likely not a problem of the javafx-maven-plugin but of the com.oracle.tools.packager.windows.WinExeBundler or WinAppBundler itself. There is somewhere a check if the bit-architecture of the executing JRE is the same as the JRE which should be embedded. |
Ok, I added following to my pom and it works! :) Both installers are created (64+32 bit):
This is because of https://github.com/Debian/openjfx/blob/master/modules/fxpackager/src/main/java/com/oracle/tools/packager/windows/WinAppBundler.java#L192 So: Either the bit-architecture check in WinAppBundler has to be improved or the javafx-maven-plugin should add this system property (maybe triggered by a plugin property). |
Unfortunately the created 32-bit installer (Inno Setup) produces a faulty installation: It installs under C:\Programms not under C:\Programms (x86) When starting the applilcation it says: |
This is not a problem of the two plugin executions. It's the same with an "old style" single execution configuration. You should be able to reproduce this problem by running the Maven build with a 64-bit JRE and have a 32-bit JRE declared in the plugin configuration. |
Thanks a lot for the feedback, when having enough time (maybe next two days), i will look into this. Sounds very nice to have this feature! |
I think I found something, could you retry with this configuration: <executions>
<execution>
<id>create-installer-for-windows-64-bit</id>
<configuration>
<bundleArguments>
<runtime>${jre-64-bit-path}</runtime>
</bundleArguments>
</configuration>
</execution>
<execution>
<id>create-installer-for-windows-32-bit</id>
<configuration>
<bundleArguments>
<runtime>${jre-32-bit-path}</runtime>
<win.64Bit>x86</win.64Bit><!-- overwrite System.getProperty("os.arch") for bundler-detection -->
</bundleArguments>
</configuration>
</execution>
</executions> |
I tested it. The problem is the same as described above. An 32-bit installer is created without errors but the installer installs a not runnable application. |
Could you create a sample project where I can recreate and check this scenario? |
To get the error quicker, you can remove the "create-installer-for-windows-64-bit" execution. This will just execute the 32-bit installer creation (within a 64-bit runtime [Maven]). |
Confirmed, I will work on this now. |
I'm afraid, but this feature won't be possible, because the javapackager uses native files from within I was possible to create a working native bundle, but I had to make some steps manually, which I don't want to create an utility-class/workaround for (because its no real solution): <bundleArguments>
<runtime>${jre-32-bit-path}</runtime>
<win.64Bit>x86</win.64Bit>
<win.launcher.rebrand>false</win.launcher.rebrand>
<win.launcher.url>file:///some/path/to/resource/AS-URL/from/jdk/32bit/WinLauncher.exe</win.launcher.url>
</bundleArguments> Then I extracted The produced JRE will copied properly when having set Another hint: since it is possible to have java-version-mismatch for jdk/jre with modified runtime, more problems will arise: the packager changed since 1.8.0_25 by adding the DLL-files (see above), and having old JDK with configured newer JRE produces non-working bundles (because of missing DLL-files). Therefor, the best solution for now is to run maven with 32 / 64-bit-JDK. |
Only solution is to have both versions of the JDK extracted/installed, and you have to override plugin-dependency with your custom path: <plugin>
<groupId>com.zenjava</groupId>
<artifactId>javafx-maven-plugin</artifactId>
<version>8.1.3-SNAPSHOT</version>
<dependencies>
<dependency>
<groupId>javafx-packager</groupId>
<artifactId>javafx-packager</artifactId>
<version>1.8.0_20</version>
<scope>system</scope>
<!-- <systemPath>${jdk.32bit.home}/../lib/ant-javafx.jar</systemPath> -->
<systemPath>${jdk.64bit.home}/../lib/ant-javafx.jar</systemPath>
</dependency>
</dependencies>
</plugin> |
Ok, thanks for the investigation! |
To sum it up in my words:
What can we do?
What do you think? |
https://javafx-jira.kenai.com/browse/RT-40718 [Native installers - provide a way to build a 32bit installer with 64bit JDK (and vice versa)] |
Updated link: https://bugs.openjdk.java.net/browse/JDK-8091056 |
@what configuration could I use to generate an installer for 32 bit windows on my x64 machine? I am trying this configuration, result with skipping
|
@maxiwu Currently there is no support, you will have to run maven with a different JDK set via JAVA_HOME on your 64bit machine. As discussed on the OpenJDK-bug, this is a jdk-problem with the bundling-system they are using. 32bit files/binaries are not contained inside 64bit installations (this is the mayor pain). |
@FibreFoX a workaround using maven in command line is good enough. I've changed my JAVA_HOME to a 32 bit Oracle JDK. And I run "mvn" package. With the right configuration, this should result in a 32 bit installer, if I am reading the discussion correctly. I think the configuration which I am using above is not correct. |
Hi,
we want to create two different native installers in one Maven build process: for Windows 64-bit and 32-bit. We execute Maven with a 64-bit JRE.
So we have two executions for the javafx-maven-plugin, one with a 64-bit JRE-path specified as runtime and one execution with a 32-bit JRE-path.
The 64-bit installer is created unproblematically, but when building the 32-bit installer following warning is printed and the 32-bit installer creation process is canceled:
Bundler EXE Installer skipped because of a configuration problem:Bit architecture mismatch between FX SDK and JRE runtime.Advice to fix: Make sure to use JRE runtime with correct bit architecture.
We think it's an important ability of an installer-creator to create both, 32-bit and 64-bit installer in one build process (e.g. mvn clean release:prepare release:perform).
Best regards
The text was updated successfully, but these errors were encountered: