Updating Java

Lofty Worm
Lofty Worm used Ask the Experts™
From an Admin perspective (command line, file locations, config files),
How can I tell where java is installed?
How can I tell if/where there are multiple versions (version6,7,8/x86/x64)?
How can I update from a central source?

I think Java is a simple copy and overwrite, but I am not sure where to, and if I am looking in the right places.
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Starting with Windows Vista and later versions, when you restart your system, the Windows process jucheck.exe (also known as Java Auto Updater), is initiated and attempts to check for the latest Java version. The Windows User Account Control (UAC) prompts you to allow this process to run.

Infomation from:
Director of Information Technology
  1. I would recommend using Powershell and WMI Queries to locate and uninstall all instances of Java.
  2. Download the offline copy of both x86 & x64.  After version 8.5x or some version close to that you were able to run the exe with some switches to run silently and also remove any older versions of Java.  Save each of these exe's in a central shared location on your network
http://javadl.oracle.com/webapps/download/AutoDL?BundleId=211997 (x86)
http://javadl.oracle.com/webapps/download/AutoDL?BundleId=211999 (x64)

Here is a simple Powershell I put together.  
$javas = Get-WmiObject -Class Win32_Product -Filter "name like 'java%[6-8]%'"
#For an alternative you can also use the IndentifyingNumber as a filter  
#Replace Name with "IndentifyingNumber Like '{26A24AE4-039D-4CA4-%'"
    foreach ($java in $Javas)
        Start-process 'C:\Windows\System32\msiexec.exe' "/x $($java.IdentifyingNumber) /qn" -wait
#This part will run each offline exe in slient mode and will remove all older version
        Start-Process '\\Server\share\Java_i586.exe' "/s REMOVEOUTOFDATEJRES=1" -wait
        Start-Process '\\Server\share\Java_x64.exe' "/s REMOVEOUTOFDATEJRES=1" -wait

Open in new window

Once you have this version of java installed you will not need to use the WMI query to uninstall older versions since the REMOVEOUTOFDATEJRES switch is available
If you want to just find the versions

If Windows is 32 bit, Java is located in Program File\Java\

If Windows is 64 bit, the 32 bit Java is installed in  Program File (x86)\Java\
                  the 64 bit Java is installed in  Program File\Java\
You can see the version in the release file.
Program File (x86)\Java\*\release
Program File\Java\*\release

You can find the list of installed versions in the registry.  



TY for your comments.  Let me see if I can filter this out;
I am not interested in removing Java necessarily, but know what is there and how to patch it.  So if I read these correctly, what I am hearing is;
  • In order to patch, old versions need to be removed.
  • The default locations for Java will be PF and PF (x86) respectively.
  • There is a file at Program File\Java\*\release
  • The reg key •HKEY_LOCAL_MACHINE\Software\JavaSoft\Java Runtime Environment will also tell

OK, so what about central patching?  Can I just download and extract and copy out the files?  I think this may be bad practice since the folder naming convention may get out of sync, but maybe I could just add the new folder, and adjust a reg key.

Additionally I am told that (when I have to do this manually :P that I have to do the Java control Panel update, and then do it all over again in Firefox.  Seems incorrect to me, but I am the new guy so...

One note to understand, these are workstations that require virtually 100% uptime, so experimenting with them is not an option.  Hence why I am asking what seem to be basic questions.
yo_beeDirector of Information Technology

Do you have to run multiple version and builds of Java.
Ultimately this is not a good practice being that 1.6 and 1.7 are so far out of date.

If you do not need any of the older versions I would recommend you uninstall all previous versions and install the latest.

My response outlines this.

If you are looking to get an inventory you can use WMI to query all your systems for all the versions out there.  This will be a bit time consuming, but can be done.

Are you familiar with WMI at all?


I do not need multiple versions of java.
My other questions still remain though.  I guess the simple of it is 'how do I patch/install java remotely'
yo_beeDirector of Information Technology

Using a logon script like the one I posted.


Ah ha, I see I am the victim of my impatience once again.  I wasn't thinking of a scripted solution, but a command line.  I see now that I can deconstruct this to do what I.
My apologies, I should have paid closer attention.  TY, this will be great!
yo_beeDirector of Information Technology

No problem and glad it help.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial