How to remove old version of java during silent install?

I want to install Java silently and during this install, I want to uninstall older versions of Java.

Since 8.20 , there is an option to uninstall older version when you run the install (via the GUI).

So I want to know if there is an option for my command line when I want to install it?

Currently, the command line looks like:

java.exe /s

Thanks for your help.

2 Answers

If you want to uninstall older veserion of java :

Start /wait msiexec.exe /x {Product code of your older java 64bit} /qn /norestart

First we need to find the product code of java older version. For this go to regedit in path HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall and find your java version.

For my case of Java 8 Update 31 is 26A24AE4-039D-4CA4-87B4-2F83218031F0 for 32 bit.

For 64 bit only change this number 32 to 64: 2F83218031F0 to 2F86418031F0.

For more information see full post here.

1

Per the Java website you can enable this by adding REMOVEOUTOFDATEJRES=1 so it would be java.exe /s REMOVEOUTOFDATEJRES=1

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like