How the installer finds a JRE

  
 previous up next 


  GUI installers generated by install4j are native and can start running without a JRE. However, the installer itself requires a JRE and so the first action of the installer is to locate a JRE that is suitable for both the installer and your application. In this process it performs the following steps:
  • Look for a statically bundled JRE. If a statically bundled JRE is included with the installer, it will unpack it and use it. First, this JRE is unpacked to a temporary directory, later it is copied to a location that depends on whether the bundled JRE is configured as shared or not.
    • not shared
      It is copied to the jre directory in the installation directory of your application. No other installer generated by install4j will find this JRE. It will not be made publically available (e.g. in the Windows registry).
    • shared
      It is copied to a common folder which depends on the operating system (e.g. C:\Program Files\Common Files on Microsoft Windows with an English locale). Other installers generated by install4j will find this JRE. It will not be made publically available (e.g. in the Windows registry). For each Java version, only one such JRE can be installed. Shared JREs are never uninstalled.

    Your application will also use the JRE selected by the installer.

  • Look for a suitable JRE in the standard locations. On Microsoft Windows the registry contains information on installed JREs, on Unix platforms there is a number of standard locations which are checked, on Mac OS X the location of installed JREs is always the same.
  • If no JRE has been found, the installer notifies the user and offers the following options:
    • Download a dynamically bundled JRE
    • Manually locate a JRE
    • Cancel the installation

    You can force the installer to skip the first two steps and show this dialog immediately with the -manual command line parameter.