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 /sThanks 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 /norestartFirst 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.
1Per the Java website you can enable this by adding REMOVEOUTOFDATEJRES=1 so it would be java.exe /s REMOVEOUTOFDATEJRES=1