This project has moved and is read-only. For the latest updates, please go here.

[Solved] Uninstalling all previous JAVA JDK versions and Installating JAVA JDK 7u40

Topics: Publishing Issue
Oct 14, 2013 at 1:20 AM
Hello Team,

Recently got to know about this wonderful product.
Planning to roll out in our environment, starting with JAVA JDK.

Please provide with the steps to be followed to install JDK (.exe version)

We have different version of JAVA JDK installed in our infrastructure, would like to uninstall all the previous version and install only the recent one JAVA JDK 7u40
  1. If currently installed version is latest one (7u40) - then proceed to Exit
  2. If the installed version is older - then
    A. stop IE, Firefox and any other dependencies
    B. uninstall all the previous version of JAVA (JDK + JRE)
    C. install JDK (7u40)
    D. Exit
Oct 14, 2013 at 9:02 AM
Hi, I recommend to always use MSI version. As Exe version will not do anything if IE or other browser is running while trying to deploy the newest release.

In addition, using MSI will uninstall older version of Java (If same major release, that mean Java 7u40 will uninstall Java7u21 but not Java 6)
Oct 14, 2013 at 11:18 AM
Dear DCourtel,

Thanks for the quick reply.
Few queries:
  1. Where can I get the MSI version of JAVA JDK files, as Oracle distributes only EXE version. Are you referring to TEMP folder with 1 MSI and 4 CAB files?
  2. In our environment, we have different releases of JDK7, 6 and JDK 5 as well, want to standardize this to all machines with JDK 7 only.
  3. Currently I am using powershell script to uninstall and install the JDK 7u40, but in future if Oracle release 7u41 then I will be again in same trouble of uninstalling and reinstalling latest JDK on every single machine manually, I want to automate this task along with other updates like Adobe, Skype, 7zip .....
  4. How to use powershell script with this tool
Oct 14, 2013 at 2:38 PM
1.Where can I get the MSI version of JAVA JDK files, as Oracle distributes only EXE version. Are you referring to TEMP folder with 1 MSI and 4 CAB files?
Sorry, it's my bad. it's the EXE file that can install JAVA even if IE is open. So use EXE file.
4.How to use powershell script with this tool
You have to create a Custom Update (and not a classic update), which allow you to run script. See documentations.
Oct 17, 2013 at 4:05 PM
Edited Oct 17, 2013 at 5:52 PM
Thanks for the update.

Please provide process on
  1. How to detect and uninstall all previous versions of java and then only install only the latest one - ex: uninstall 6u30 and install 7u40 from JAVA JDK application
  2. How to run powershell script in WPP with screenshots
In current scenario, all old versions of Java are still remained on the machines after installing recent ones.
Process Steps as followed:
  1. Identify the current version
  2. If doesn't match with WPP one, run powershell script to uninstall JAVA
  3. After all uninstallations, then install WPP published JDK
Oct 18, 2013 at 9:17 PM
1.How to detect and uninstall all previous versions of java and then only install only the latest one
Make a Powershell or VB script to search for registry key in the :
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall
Base your search on the 'UninstallString' value.

For every registry key you found, launch MsiExec to uninstall this version of Java.

Then launch the EXE file of the version of Java you want to install.
How to run powershell script in WPP with screenshots
Follow this 'How To' : Custom Update
Marked as answer by DCourtel on 1/17/2014 at 8:01 AM
Jun 4, 2014 at 9:39 AM
Hi,

I tried several times, my Powershell script works locally, I put it before the step to run msiexec in my Custom Update, but the problem is still there.
I'm trying to update Java6u23 to Java7u55 in 2003 / XP environment.

Where did you place this step ?

Nicolas
Jun 4, 2014 at 2:35 PM
Well I'm sorry,

my script did not work as expected, but I found another that works perfectly there :
http://ivan.dretvic.com/2011/02/who-hates-java-how-to-remove-all-java-installations-on-your-network/

Thanks for help, Nicolas