Guys, I'm having a huge headache with Java at the moment. In the past the company was manually installing Java on the PCs and we really need to move to GPO deployment for centralized management and upgrades. The problem is that if I just add Java as a GPSI install, it won't install correctly. Various issues occur but the most common scenario is that it will break the old install and be unable to install the newest version, leaving the PCs with no functioning Java whatsoever. I've read online all I could to find scripts and ways to uninstall Java but none seem to work 100%. A script might work on my PC but not work on the other computers and it's a different problem almost every time. The most frustrating part is that if I manually install the Java from the same file the GPO is using (i.e navigate to the server UNC and double click the installation) it will successfully install fine and dandy, but not if it's automated using GPSI. I know you can use PDQ Deploy as well but my boss doesn't want to add any external software like that and would only like to use AD. What can I do here?
Currently I'm (trying) using this script:
@ECHO OFF
if exist "c:\java_uninstall.txt" goto end
START /WAIT /MIN WMIC product where "Name LIKE '%%J2SE Runtime%%'" call uninstall /nointeractive
START /WAIT /MIN WMIC product where "Name LIKE '%%Java%%'" call uninstall /nointeractive
echo java_uninstalls older java 6-7 uninstalled. > c:\java_uninstall.txt
echo Do NOT delete this file as it will cause Java to uninstall on next 'gpupdate'. >> c:\java_uninstall.txt
attrib +h c:\java_uninstall.txt
:end
exit
It does not do the trick on most computers. Any help will be greatly appreciated.