Creating an installer that installs the JRE
Advanced Installer has the ability to create install packages that install the JRE as well as your Java application. With just a few mouse clicks in the friendly User Interface you can either bundle the JRE with your application or create a package that checks for, (if necessary) downloads and installs the JRE.
The JRE dependency
As Java developers know, the Java language and Virtual Machine, for all their benefits, have one significant drawback: they require the Java Runtime Environment (JRE) to be installed on the target machine for Java programs to run. Without it, a Java product will silently fail to run, unfortunately without giving the user any clue about what went wrong.
Check for the installed JRE and its version
The first help Advanced Installer offers is through its advanced Native Java Launcher. When starting a Java product packaged with Advanced Installer, the launcher will search for a suitable JRE installation. If none is found, a helpful error message will be presented to the user.
This first level is very important, because it will be your fall back in case the installed JRE disappears at some point. The next step it to avoid this message and make sure that the JRE is installed before starting the Java product. Advanced Installer offers two solutions:
1. Download and install the JRE on demand
This is can be accomplished using the Prerequisites functionality of Advanced Installer. By specifying the JRE as a prerequisite, Advanced Installer will generate a package which, upon installation, checks if a JRE of the required version is present on the target machine. If it is not, a JRE install package will be downloaded from an URL you specify and run.
The main advantage of this solution is size: the install package is kept to a minimum. The JRE will only be downloaded and installed if it is not found on the target machine already.
2. Bundle a JRE with your application
Advanced Installer has the ability to generate an installer package which bundles a Java Runtime Environment you specify. This JRE will be placed alongside with your application and it will be used when starting it. The JRE will not be formally installed, so it won't be available to other applications. It will be private to yours.
The main advantage of this solution is stability: the bundled JRE will always be available and used for your Java product. The user cannot unintentionally break your application by uninstalling or replacing the JRE .