Deploying Java can be a real pain! While using this Java Deployment Guide, we recently ran into an issue where an updated version of Java would not install through Group Policy. What we needed was an automated way to uninstall Java regardless of the version.
A quick search of Google turned up numerous results with the same issue. We found that we were able to correct the issue with JavaRa when ran manually. To have three people download and run JavaRa on 1500 workstations was out of the question though. I knew there had to be a way to fix it and I was fortunate enough to find a script which automated the removal process for any Java version. The script can be found at the very bottom of this article.
This script solved the problem of getting the old version of Java off of the computer. Because the policy had already applied though, machines were still not installing the new version of Java. That was quickly remedied by adding the following line onto the batch file.
“\\server\software\jre1.7.0_25\jre1.7.0_25.msi” /passive /norestart
As a note, you can also remove the stuck Application GPO by using the tool MSIManger. That tool can be found under the Active Directory/Group Policy section on this page.
This left one final obstacle, how do I get this file to run on the computers that need it without the necessity of my staff going around to log in to each one individually? We decided to use a startup script that we distributed to all of our computers. This also meant we had to add one final line to the startup script so the machine would automatically reboot once the java install was complete.
shutdown /r /t 0
We have since deployed Java 7 Update 40 and haven’t had any additional errors.