JRE Bundle Wizard

## 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: JRE bundles are not supported on Mac OS X for both technical and legal reasons.

| 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 `.install4j5/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 `1.6.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 "1.6.0_18". If you want to use a shorter version number like "1.6.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.

| 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:
Attribute | Description | Required
--- | --- | ---
javahome | The home directory of the JRE that should be bundled | Yes
output | The output directory | Corresponds to the `--output` command line option described above.
version | Corresponds to the `--version` command line option described above. | No
code | Corresponds to the `--code` command line option described above. | No
Example:
          <createbundle javahome="/usr/lib/jvm/java-1.6.0_18/jre"
                        output="/home/build/projects/myproject/jrebundles"
                        version="1.6.0"
                        code="j3d"
          />