Documentation Contents
Java Platform, Standard Edition Installation Guide
Contents    Previous   

20 Installing the JDK and the JRE with a Configuration File

You can use a configuration file to standardize JDK and JRE installations and specify options that are not available on the command line. An installer configuration file is an alternative to, and extension of, options specified on the installer command line.

Note: Windows, macOS, Linux, and Solaris command-line installers support the configuration file, but not every operating system supports all configuration file options.

This page has these sections:

Using a Configuration File

If you are installing the JRE or JDK on Windows, use the INSTALLCFG command-line option to specify a configuration file:

installer INSTALLCFG=configuration_file_path

  • installer is the installer base file name, for example, jre-8u211-windows-x64.exe or jdk-8u211-windows-x64.exe.

  • configuration_file_path is the path to the configuration file.

If you are installing the JRE or JDK on Solaris, Linux, or macOS, create a configuration file name named /etc/java/config/jre-install.properties. When you launch the JRE or JDK installer, it looks for a configuration file with this specific path and name.

Configuration File Options

The following table lists the installer configuration file options that apply for each operating system.


Note:

  • You may substitute the value Enable for 1 and Disable for 0.
  • You may use some of these options on the command line when running the JDK or JRE Windows Offline Installer. See "Command-Line Installation".
  • Some options are specific to the Microsoft Windows Installer (MSI) Enterprise JRE Installer. This installer enables you to install the JRE across your enterprise. It requires a commercial license for use in production. See MSI Enterprise JRE Installer Guide for Windows for more information.

Table 20-1 Configuration File Options

Option Operating Systems Supported Windows Installer (EXE or MSI) JDK or JRE Value or values Description Default Value Used in the configuration file Used on the command line Saved in Runtime Configuration File?
DEPLOYMENT_RULE_SET= Windows EXE, MSI JDK, JRE path Specifies the path and file name of your organization's deployment rule set. See Deployment Rule Set in Java Platform, Standard Edition Deployment Guide. none yes yes yes
EULA= Windows EXE, MSI JRE 1, 0 When EULA=1 is set, the installer prompts the user to accept the end-user license agreement (EULA) if a Java applet or Java Web Start application is launched. 0 yes yes yes
INSTALL_SILENT= Windows EXE JDK, JRE 1, 0 When INSTALL_SILENT=1 is set, the installer performs a silent (non-interactive) installation. 0 yes yes no
INSTALLDIR= Windows EXE, MSI JRE path Specifies the folder or directory into which the files are installed.

By default, the 32-bit version of the JRE is installed in C:\Program Files (x86)\Java\jren, where n is the full Java SE release and update number. For example, n is 1.8.0_421 for JRE Release 8 Update 421.

Similarly, by default, the 64-bit version of the JRE is installed in C:\Program Files\Java\jren.

Note: Linux and Solaris use operating system tools for this purpose, and installation directory relocation will be handled by operating system tools (for example: rpm --prefix=path).

Operating system default path yes yes no
INSTALLDIRPUBJRE= Windows EXE JDK path When installing the JDK, this option specifies the folder where the public JRE is installed.

Note:

  • You must perform a silent install to use this option.

  • You must add a forward slash (/) before this option's name. For example:

    jdk-8version-windows-x64.exe /s /INSTALLDIRPUBJRE=C:\custom\javadir

Operating system default path yes yes no
NOSTARTMENU= Windows EXE, MSI JDK, JRE 1, 0 When NOSTARTMENU=1 is set, the installer installs the JDK or JRE without setting up Java start-up items. 0 yes yes no
REBOOT= Windows MSI JRE 1, 0 When REBOOT=1 is set, the installer behaves as follows, depending on its mode:
  • UI mode: After installing the JRE, the installer prompts you to restart your computer only if it detects that a reboot is required.
  • Silent mode: After installing the JRE, the installer automatically restarts your computer if it detects that a reboot is required.
1 yes yes no
REMOVEOUTOFDATEJRES= Windows EXE JRE 1, 0 Note: You must perform a silent install to use this option.

Enables uninstallation of existing out-of-date JREs during JRE install.

By default, the installer leaves all out-of-date Java versions on the system. Setting REMOVEOUTOFDATEJRES=1 removes all out-of-date Java versions from the system.

For example, running jre1.8.0_60.exe /s REMOVEOUTOFDATEJRES=1 will remove all JREs below the security baseline. JREs above the security baseline will not be uninstalled.

0 yes yes no
RETAIN_ALL_VERSIONS= Windows MSI JRE 1, 0 Note:
  • The option RETAIN_ALL_VERSIONS has been disabled in JRE 8u421. If you use this option, the installer ignores it and generates a warning. Set STATIC=1 instead to protect older JRE 8 versions from being uninstalled during a manual upgrade or an automatic update (see the subsection Update in "Java Control Panel" in Java Platform, Standard Edition Deployment Guide).

  • The JRE MSI installers for JRE 8u371 and later removed the ability to retain older JRE versions already installed on disk. (The REMOVEOLDERJRES option was disabled in these versions.) Customers that need to retain older JRE versions should use the RETAIN_ALL_VERSIONS option in releases between JRE 8u381 b32 and JRE 8u411 downloaded from My Oracle Support.

When RETAIN_ALL_VERSIONS=1 is set on the command line, it enables the installation of multiple JREs of the same family without removing other versions of JRE 8. The JRE MSI Installer installs JRE 8 in a directory named jre$fullversion directory instead of in the default jre-1.8 shared directory. For example, if RETAIN_ALL_VERSIONS=1 is set, then JRE 8u381 would be installed in a directory named jre1.8.0_381 instead of the default jre-1.8 shared directory.

Note:

  • INSTALLDIR cannot be set to Program Files\Java\jre-$family if RETAIN_ALL_VERSIONS=1 is set.
  • INSTALLDIR cannot be set to Program Files\Java\jre$fullversion if RETAIN_ALL_VERSIONS=0 is set.
0 no yes no
STATIC= Windows MSI JRE 1, 0 When STATIC=1 is set, the installer performs a static installation of the JRE. This means that a manual upgrade or an automatic update performed by the Java Auto Update feature leaves that JRE installed. This option ensures that vendors, who require a specific version of the JRE for their product, can be certain that the JRE will not be overwritten by a newer version.

See the subsection Update in "Java Control Panel" in Java Platform, Standard Edition Deployment Guide for more information about the Java Auto Update feature.

The junction C:\Program Files (x86)\Java\jre-1.8 will point to the latest 32-bit JRE 8 update release installed in your computer. Similarly, the junction C:\Program Files\Java\jre-1.8 will point to the latest 64-bit JRE 8 update release installed in your computer. See Default JRE Installation Directories.

0 no yes no
USAGETRACKER_CFG= Windows EXE, MSI JDK, JRE path Specifies the path and file name of the Java Usage Tracker properties file. See Java Usage Tracker Guide. none yes yes yes
WEB_ANALYTICS= Windows, macOS EXE, MSI JRE 1, 0 When WEB_ANALYTICS=1 is set, the installer sends installation-related statistics to an Oracle server. 1 yes yes yes
WEB_JAVA= Windows, macOS, Linux, Solaris EXE, MSI JRE 1, 0 When WEB_JAVA=1 is set, the installer configures the installation so downloaded Java applications are allowed to run in a web browser or by Java Web Start. 1 yes yes yes
WEB_JAVA_SECURITY_LEVEL= Windows, macOS, Linux, Solaris EXE, MSI JRE H (high), VH (very high) Configures the installation's security level for Java applications running in a browser or run with Java Web Start. VH yes yes yes

Sample Configuration File

The following is a sample JRE configuration file for Windows. It specifies the following:

  • Perform a silent install
  • Don't set up Java start-up items
  • Configure the JRE so that downloaded Java applications are not allowed to run in a web browser or by Java Web Start

Example 20-1 Sample Configuration File for Windows

INSTALL_SILENT=1
NOSTARTMENU=1
WEB_JAVA=0

System Runtime Configuration File

After installing the JDK or JRE with a configuration file, the installer saves the file (with a subset of options used during install) in one of the following locations in your computer, depending on your operating system:

  • Windows: Either Program Files\Common Files\Oracle\Java\java_settings.cfg or Program Files (x86)\Common Files\Oracle\Java\java_settings.cfg.

  • Solaris and Linux: /etc/Oracle/Java/java.settings.cfg

  • macOS: /Library/Application/Support/Oracle/Java/java.settings.cfg

Contents    Previous   

Oracle and/or its affiliates Copyright © 1993, 2024, Oracle and/or its affiliates. All rights reserved.
Contact Us