createbundle command line refuses to generate Mac bundle on Windows - install4j

https://stackoverflow.com/a/57802270/6944068 says "You can generate macOS JRE bundle on Windows."
However, my attempt failed, see transcript:
C:\develop\projects\id-gui\target\downloads\jre-bundles>..\install4j8.0.8\bin\createbundle C:\develop\projects\id-gui\target\downloads\jre-bundles\zulu11.41.24-sa-jdk11.0.8-macosx_x64
The JRE bundle wizard can only create JRE bundles for the platform you're currently running on.
The java home directory C:\develop\projects\id-gui\target\downloads\jre-bundles\zulu11.41.24-sa-jdk11.0.8-macosx_x64 contains a JRE for a different platform.
What's wrong?

The cross-platform generation only applies to bundles that are generated via the mechanism configured on the "General Settings->JRE bundles" step. The createbundle command line tool creates "pre-created JRE bundles", in the install4j IDE you would do the same with "Project->Create a JRE bundle". Those bundles can only be generated on the platform that they are intended for because they rely on a working local installation.

Related

Bundled JRE error with install4j installer packaged as msix

We create an installer with install4j that bundles the JRE. We then use the MSIX Packaging Tool to create a .msix installer, to publish on the Microsoft App Store.
When we install the .msix package for testing and try to run the application, we get the following error:
"The JVM found at .\jre is damaged. Please reinstall or define EXE4J_JAVA_HOME to point to an installed 64-bit JDK or JRE"
Note that the JRE is bundled with the installer, and it is actually installed in a folder called "jre" under the installation folder.
When we install from the .exe installer, everything works fine, this problem only happens after we create a .msix installer with the MSIX Packaging Tool. We've checked all the installed files and everything looks fine, but the launcher will not run.
Has anybody seen this problem? And is there a solution or workaround?

Bundle Jre downloaded as maven dependency with Install4J

I am using maven to build my install4J project. I am downloading jre.tar.gz into my project using a Maven dependency. I want to bundle this Jre with Install4J.
I have created a compiler variable bundleJRE which is the path to the jre.tar.gz file, and I created the installer executable.
While installing on a non-java machine, I get an invalid JRE error. Do I need anything else to be configured? How can I bundle this?
We have the same way to build our installer with maven. If the jre is packed correctly ensure the search sequence for the JRE is set to the installation folder first (or only). You can configure that in the "General Settings -> Java Version" configuration tab. We only added the installation folder and deleted all the other entries. Also ensure the minimum java version matches with your bundled one.

Bundle Jre with Install4J

I have downloaded JRE (jre-x64-1.8.0_40.zip) using Maven Dependency.
I want to Bundle this Jre to install4J.
When I am trying to bundle this, during building it is showing error as FileNotFoundException and looking for File jre-x64-1.8.0_40.zip.tar.gz.
How can I bundle jre zip?
If not, does install4j provide feature to convert file type?
You can create install4j JRE bundles from installed JREs by invoking Project->Create a JRE Bundle from the main menu or by using the createbundle command line utility.
It is not possible to directly convert a ZIP with a JRE or an archive downloaded from the Oracle web site into a JRE bundle that is usable by install4j. You have to install the JRE first in any case.
This has changed with install4j 8. For details, see section "JRE bundle format" on https://www.ej-technologies.com/resources/install4j/help/doc/concepts/jreBundles.html.

How do i prepare a JRE of Java 1.8.0 EA for shipping with my Mac OS X app's installer?

My goal is to bundle a JRE of JDK 1.8.0 ea (build 120 in this case) with my application files, so that the launcher which is generated by install4j will utilize this jre to run the app.
Now, when i'm trying to set the JRE in the media files options, i can't do the same as in the windows version with a windows JRE. In that case, i was just pointing to the directory the JRE resides in. As i see in the installer build log, it's expected to have a jre.tar.gz in the path that i set manually. So i packed the JRE subdir of the JDK into a jre.tar.gz file. Now, the installer is built without warnings or errors. But when i try to start the installer, it shows me an internal error: "launch path is not accessible".
This is strange because i expected an error to maybe come up when i'm launching the App, but not at this point already.
The opposite comes up when i'm using a JRE v1.7 to set as a bundled JRE in the media file. In this case, the installer starts and the program - of course - doesn't.
How do i have to prepare my Java 8 JRE to ship with my app but not cause the installer to crash?
Use
Project->Create a JRE Bundle
in the install4j IDE. It may not work with Java 8 though. We will support Java 8 JRE bundles when it is released.

How do I bundle a Solaris JRE with install4j without running the install4j application on Solaris?

The JRE download wizard in install4j only offers Linux and Windows JREs. I need to build a media file that bundles a Solaris JRE. install4j supports building custom JRE bundles but it's JRE Bundle wizard states:
"Please note that the JRE Bundle wizard can only create JRE bundles
for the platform you're running on."
This seems like a serious omission as compared to the other multi-platform install buliders (i.e. InstallAnywhere and InstallBuilder) both of which provide bundled Solaris JREs.
Can I not just unzip/tar a Solaris JRE on my Linux build box and bundle it? Or is there a limitation of the mechanism used to bundle it?
Even though we support Solaris, Solaris boxes are in limited supply.
Can I not just unzip/tar a Solaris JRE on my Linux build box and bundle it?
You would have to create the tar.gz file for the bundle manually as explained here (at the bottom of the page).
However, I would rather suggest adding a requirement that Java is installed on the Solaris box. Bundling a JRE on Solaris is somewhat risky since particular JRE versions require certain OS patches.