JRE Bundle Wizard


  With the JRE bundle wizard you can create JRE bundles for install4j from any JRE installation on your disk. For more information on JRE bundles and on how they are used by install4j, please see the corresponding help topic.

Please check first, if one of the JREs provided by ej-technologies' JRE download server fits your needs.

Note that JRE bundles can only be created on the platform where they are intended to run. For example, it is not possible to create a Linux JRE bundle on Windows. You have to install install4j on a Linux machine and run the JRE bundle creation process there.

  The JRE bundle wizard is started by choosing Project->Create a JRE Bundle from install4j's main menu. The JRE bundle wizard leads you step by step through the process of choosing the desired JRE and creating an install4j bundle from it:
  • Select JRE
    In the "Select JRE" step of the wizard you select the Java home directory of the JRE. It is possible to select a JDK, however, after a confirmation dialog the bundle will be created from the included JRE.
  • Output directory
    By default, the JRE bundle file is saved to the jres directory in your install4j installation directory. If that directory is not writable, the .install4j7/jres directory in your home directory is used. Bundles in the default directory will be suggested by the IDE.

    You can also save your bundle to any other directory and use the Manual entry option in the Bundled JRE step of the media wizard to select the bundle file.

  • Bundle file name
    The file name of the bundle is auto-generated and is used by the install4j IDE to suggest suitable JRE bundles in theBundled JRE step of the media wizard. You can customize the following components of the file name:
    • Java version
      Enter the version of the JRE. This is useful if you would like to use a version without patch level information, such as 9.0.
    • Custom ID
      This should be short identifier that will be presented in the IDE in order to differentiate multiple bundles with the same architecture and Java version.

    The version and the custom ID are used to construct the name of the bundle file. The format of the name is important for the IDE to recognize the file as a bundle and determine its scope.

  To automate the JRE bundle creation, you can use the command line utility createbundle[.exe] in the bin directory of your install4j installation. The bundle creation tool is invoked as follows:
createbundle [OPTIONS] [JRE home directory]

The available options are:

  • -h or --help
    Displays a quick help for all available options.
  • -o or --output
    The directory where the bundle file will be created. If you do not specify this option, the default bundle directory of install4j will be used.
  • -v or --version
    The version string for the JRE. If you do not specify this option, the JRE will be queried for the version, for example "9.0.3". If you want to use a shorter version number like "9.0", you can use this option.
  • -i or --id
    The custom ID of the JRE as described above. If you do not specify this option, it will be set to the empty string. This is only required if you have multiple bundles with the same architecture and Java version. This id becomes part of the name of the bundle file.
  • -u or --unpacked
    If this flag is specified, the JAR files are not packed with the Pack200 algorithm. This makes the JRE bundles substantially larger. Unpacked JRE bundles are required for single bundle archives on macOS, where signature requirements prevent any modifications in the installed application bundle.
  Creating a JRE bundle from your ant script (read about ant at ant.apache.org) is easy. Just use the createbundle task that is provided in $INSTALL4J_HOME/bin/ant.jar and set the javahome parameter to the JRE that you want to create a bundle for.

To make the createbundle task available to ant, you must first insert a taskdef element that tells ant where to find the task definition. Here is an example of using the task in an ant build file:

<taskdef name="createbundle"
         classname="com.install4j.CreateBundleTask"
         classpath="C:\Program Files\install4j\bin\ant.jar"/>

<target name="media">
  <createbundle javahome="c:\Program Files\Java\jre6"/>
</target>

The taskdef definition must occur only once per ant-build file and can appear anywhere on the top level below the project element.

Note: it is not possible to copy the ant.jar archive to the lib folder of your ant distribution. You have to reference a full installation of install4j in the task definition.

The createbundle task supports the following parameters:

 
AttributeDescriptionRequired
javahomeThe home directory of the JRE that should be bundledYes
outputDirectoryThe output directory Corresponds to the --output command line option described above.
version Corresponds to the --version command line option described above. No
id Corresponds to the --id command line option described above. No
unpacked Corresponds to the --unpacked command line option described above. No

Example:

<createbundle javahome="/usr/lib/jvm/jre-9.0.4/jre"
              output="/home/build/projects/myproject/jrebundles"
              version="9.0"
              id="j3d"
/>