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/ 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.


  • You may substitute the value Enable for 1 and the value 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 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 Enable, Disable Prompts the user to accept the end-user license agreement (EULA) if a Java applet or Java Web Start application is launched. Disable yes yes yes
INSTALL_SILENT= Windows EXE JDK, JRE Enable, Disable Performs a silent (non-interactive) installation. Disable yes yes no
INSTALLDIR= Windows EXE, MSI JRE path Specifies the folder or directory into which the files are installed.

Beginning with JRE 8u371, the default installation directory changed to Program Files\Java\jre-$family or Program Files (x86)\Java\jre-$family, where $family is 1.8.

To specify a different install folder or directory, set the INSTALLDIR option on the command line. The INSTALLDIR option removes the current installation directory and its contents before installing the new JRE in the location specified by the option.

Note: You cannot use the INSTALLDIR option to install an earlier version of the current JRE in a different location.

Beginning with JRE 8u381 b32, you can use the RETAIN_ALL_VERSIONS option to install later versions of an installed JRE.

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 no yes no
INSTALLDIRPUBJRE= Windows EXE JDK path When installing the JDK, this option specifies the folder where the public JRE is installed.


  • 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 Enable, Disable Specifies that the installer installs the JDK or JRE without setting up Java start-up items. Disable yes yes no
REBOOT= Windows MSI JRE Enable, Disable If disabled, the installer does not prompt you to restart your computer after installing the JRE. However, in most cases, the MSI Installer does not need to restart your computer after installing the JRE. Enable yes yes no
REMOVEOUTOFDATEJRES= Windows EXE JRE 0, 1 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. Using 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 0, 1 Note: The JRE MSI installers for JRE 8u371 and JRE 8u381 GA 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 JRE 8u381 b32 or later releases 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.


  • INSTALLDIR cannot be set to Program Files\Java\jre-$family if RETAIN_ALL_VERSIONS=1
  • INSTALLDIR cannot be set to Program Files\Java\jre$fullversion if RETAIN_ALL_VERSIONS=0
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 Enable, Disable Enables or disables the installer to send installation-related statistics to an Oracle server. Enable yes yes yes
WEB_JAVA= Windows, macOS, Linux, Solaris EXE, MSI JRE Enable, Disable Configures the installation so downloaded Java applications are, or are not, allowed to run in a web browser or by Java Web Start. Enable 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.
  • Set the security level for unsigned Java applications running in a browser to very high.

Example 20-1 Sample Configuration File for Windows


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   

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