Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Oracle states that the Java SE installer is built using MSI, but the help page, rather unhelpfully doesn't list uninstall options.

I need to do a command line uninstall, and I can't figure out or find relevant the options for 1.6.21

I've tried wrapping the installer .exe in msiexec using msiexec /q /x <jre>.exe, but this just reports that the installation package could not be opened.

Running the installer .exe with the /s /x option just hangs.

Edited to add: msiexec /x {3248F0A8-6813-11D6-A77B-00B0D0160021} /q => "This action is only valid for products that are urrently installed"

Anyone got the right command line?

share|improve this question

migrated from stackoverflow.com Mar 15 '11 at 9:51

This question came from our site for professional and enthusiast programmers.

1  
Can't you uninstall it from Control Panel -> Add/Remove Programs –  Nishan Mar 15 '11 at 9:19
2  
It's for a compute cluster so ideally it needs to be command line uninstall. –  nick3216 Mar 15 '11 at 9:24

3 Answers 3

You can find the correct product code to pass to msiexec /x by opening in the registry (regedit). Open the key:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall

Select the Uninstall key and "Find" from the "Edit" menu. Search for "Java." This should show which subkey the Java is located under. One of the keys is "UninstallString." Use this command to uninstall Java. Note however, this will only work on other machines if the exact same version of Java is installed.

share|improve this answer
    
Installing JDK 1.6u21 onto a local PC allowed me to see that the GUID isn't the one I was expecting (based on Oracle docs & Server Fault). A JRE/JDK difference. reg query HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall\{32A3A4F4-B792-11D6-A78‌​A-00B0D0160210} /v uninstallString –  nick3216 Mar 16 '11 at 9:45
    
hmm, on the compute nodes MSIEXEC reports that action is only valid for products that are installed and reg query /s HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall has no record of the JDK being installed. –  nick3216 Mar 16 '11 at 10:07
    
+1 This method worked well to uninstall a botched SQL Server 2012 rsfx driver package. –  Eddie B Mar 15 '13 at 2:57

There are 2 places where you might find the product code:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData\S-1-5-18\Products\4EA42A62D9304AC4784BF238120662FF\InstallProperties

or

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall

You should be able to find the uninstall string from the key UninstallString; something like: MsiExec.exe /X{26A24AE4-039D-4CA4-87B4-2F83216026FF}

share|improve this answer

FYI if you are on Windows Server 2012 Core and trying to find the uninstall string for Java 7, go to following place in the registry to find the uninstall string.

HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.