Java

Java in Action Downloads Help Center

Help Resources



Get Java Installation Help Now

How do I arrange a silent (unattended) Java installation?


This article applies to:
  • Platform(s): Windows XP, Windows 2000, Windows 2003
  • Java version(s): 6.0

SYMPTOMS

  • System administrators want to deploy Java on multiple PCs on their Intranet without user interaction.
  • Developers require Java to be silently installed with their products.

SOLUTION

Introduction Java installations are built using Microsoft Windows Installer (MSI) 2.0 technology. MSI contains built-in support for silent or unattended installations. This document tells how to manually install Java using the .exe that launches the MSI installation.  The installer options are explained.

Command Line Install
In Java SE 6 The Windows offline installation command has the same syntax as the Windows Installation. The command is as follows:
<jre>.exe [/lang=] [/s] [IEXPLORER=1] [MOZILLA=1] [INSTALLDIR=:\] [STATIC=1]

where

  • <jre>.exe is the single executable installer for Java
  • /lang=, if used, sets the localized language for the installer. For a complete list, please see Language IDs.
  • /s, if used, indicates silent installation
  • IEXPLORER=1, if used, indicates that the Plug-in should be registered as the default Java VM with the Internet Explorer browser
  • MOZILLA=1 indicates that the Plug-in should be registered with Mozilla 1.1 and later and Netscape browsers
  • INSTALLDIR, if used, specifies the drive and path of the installation
  • If INSTALLDIR is not specified, the installation will go into C:\Program Files\java\jre1.6.0 (default location).
  • STATIC=1, if used, specifies a static installation. This option is available in the 6u10 release and above. For more information on static install, please see . Java Runtime Environment Configuration.
Note: The following options have been deprecated starting in release Java SE 6 update 10:
  • ADDLOCAL
  • IEXPLORE
  • MOZILLA
Beginning in Java SE 6 update 10 release, the latest Java software will be registered with all browsers. This ensures that applets will run on the latest and most secure version of Java software.

Installation Configurations
Example 1
Suppose the JRE installer is jre-6-rc-windows-i586.exe and you want to install the following configuration:
  • Perform a Windows Installation
  • Install the JRE core, additional fonts, colors, and Soundbank
  • Register the Plug-in with Netscape 7 and Mozilla 1.3
The command to install the above mentioned configuration is as follows:
jre-6-rc-windows-i586.exe /s MOZILLA=1

Example 2
Suppose the JRE installer is jre-6-rc-windows-i586.exe and you want to install the following configuration:
  • Perform a Windows Offline Installation and install the JRE on D drive at java\jre
  • Have all features of the JRE installed
  • Register the Plug-in with Internet Explorer
The command to install the above mentioned configuration is as follows:
jre-6-rc-windows-i586.exe /s IEXPLORER=1 INSTALLDIR=D:\java\jre

Note: To keep the MS-DOS window open, until the installation of Java is complete use the start /w command as follows:
start /w jre-6-rc-windows-i586.exe /s MOZILLA=1

Creating a Log File
Log file can be used to verify if an installation succeeded. To create a log file describing the installation append /L C:\setup.log to the install command and scroll to the end of the log file to verify.

Installation Example
The following is an example for installation:
jre-6-rc-windows-i586.exe /s /L C:\setup.log
The above command causes the log to be written to the setup.log file.



Select Language | About Java | Support | Developers
Privacy | Terms of Use | Trademarks | Disclaimer

Sun Microsystems