Third-Party Patching for SCCM

Patch over 335+ third-party updates across 190 products in SCCM

Knowledge Base ArticlesDownload Trial

Remove Previous Versions of Java 8 Runtime During Upgrade

Starting with April’s Java Runtime Release, we will be unable to automatically remove previously JRE 8 installs by default. 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.

Please review the information below to review how you can perform the automatic removal of previous versions of JRE while installing the latest version through our catalog.

Download Powershell Scripts for Java Runtime Environment or Java SE Development Kit Uninstall

Below you can download the two PowerShell scripts for the uninstall of Java Runtime Environment 8:

Download – Java Runtime Environment 8 – Uninstall Scripts

Below you can download the two PowerShell scripts for the uninstall of Java SE Development Kit 8:

Download – Java SE Development Kit 8 – Uninstall Scripts

Note: The Java SE Development Kit 8 scripts use the same process as the Java Runtime scripts defined below, but you add the JDK scripts as a pre-update script on the Oracle Java SE Development Kit products.

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.

OPTION 1: Using Pre-Update Installation Script

The scripts above will allow you to automatically uninstall all versions of Java Runtime Environment 8 (32-Bit) and Java Runtime Environment 8 (64-Bit). These scripts can be added as a pre-update script as described below.

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 to add customer pre/post update installation script.

Add the script file Remove-JRE8-32bit-Only.ps1 as a Pre-Update Script in the prompt. Note: you need to add this as a Pre-Update script and NOT a Post-Update script otherwise all versions of JRE 8 (32-bit) will be uninstalled after the update completes.

For JRE 8 (64-bit) repeat the process above on the Oracle Java 8 (x64) product but use the Remove-JRE8-64bit-Only.ps1.

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