Remove Previous Versions of Java 8 Runtime During Upgrade

This article will describe your options for uninstalling old versions of Oracle Java while updating Java with Patch My PC.

There were changes for the Java SE licensing starting with Java 8 Update 211. Due to these licensing changes, JRE will now require you to manually download the JRE installer using the local content repository feature.

Video Guide for Java Runtime Environment Uninstall Process

Please review the step-by-step video guide for information on how to add the JRE removal during the update as a pre-update script.

Note: The video shows the process of manually including pre-update scripts to remove JRE.  Skip this video and read OPTION 1 for the Patch My PC defined scripts.

OPTION 1: Using Patch My PC Defined Scripts

The Patch My PC defined scripts will allow you to automatically uninstall all versions of Java Runtime Environment 8 (32-Bit) and Java Runtime Environment 8 (64-Bit). The defined scripts will appear as a right-click option in the Update Rules tab.

For example, to automatically remove all JRE 8 (32-bit) installations prior to installing the latest update, right-click Oracle Java 8 (x86) product in our publishing services Update Rules tab and choose Patch My PC defined pre/post update installation scripts.

The script will automatically be inserted into the Pre-Update Script box.  This option is also available for Oracle Java 8 (x64) and Oracle Java SE Development Kit 8 (x64)/(x86).

java removal patchmy pc recommended script pre-update script box

OPTION 2: Add REMOVEOLDERJRES=1 as Custom Command Line

This option is NOT recommended if your environment uses both the (32-bit) and (64-bit) versions of JRE 8 on Windows 64-bit operating systems. The reason we don’t recommend it in this scenario is that the REMOVEOLDERJRES=1 parameter will automatically remove both (32-bit) and (64-bit) JRE 8 installs regardless of the version being updated. This causes the other version to become not applicable as a software update, therefore, leaving only one installed version where a machine previously would have had both versions installed.

This option should only be used if you are only running a single JRE 8 architecture within your environment. For example only if you use the (32-bit) exclusively or you only use the (64-bit) exclusively.

To use this method to remove previous versions during the latest JRE 8 update, right-click the Oracle Java 8 (x86) / Oracle Java 8 (x64) and choose to Modify command line for product.

In the input box for the additional argument add REMOVEOLDERJRES=1

This command line should have the JRE 8 installer automatically remove previous versions using Oracle’s native installer.

Note: Neither of these options is supported if you are using the SCCM 1806+ in-console publishing option rather than our publishing service.