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.

Answer from heavyd on Stack Exchange
🌐
Oracle
java.com › en › download › help › uninstall_java.html
How do I uninstall Java on my Windows computer?
Select the program you want to uninstall by clicking on it, and then click the Uninstall button. You may need administrator privileges to remove programs. ... The Add/Remove control panel displays a list of software on your system, including any Java software products that are on your computer.
🌐
Oracle
java.com › en › download › uninstalltool.jsp
Java Uninstall Tool for macOS
If you are experiencing issues while uninstalling Java, please see the Java uninstall instructions. If you are still having trouble uninstalling out-of-date versions of Java, you can request further uninstall help. I Agree to the Terms and Want to Continue ·
Discussions

So How do I delete java from my laptop?
If you're using a Windows PC, you can uninstall Java by following the instructions on this page of the Java website. If you're using Windows 10, the instructions from the Java website are as follows: Windows 10 - Uninstall Programs Click Start Select Settings Select System Select Apps & features Select the program to uninstall and then click its Uninstall button. Respond to the prompts to complete the uninstall And the Java website also mentions that "Older versions of Java may appear in the program list as J2SE, Java 2, Java SE or Java Runtime Environment." More on reddit.com
🌐 r/techsupport
2
3
September 6, 2021
Remove Java from ALL systems.
I recommend CI/CB. Check if Java is installed. If found execute the uninstall string from the registry. $javaVer = Get-ChildItem -Path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall, HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall | Get-ItemProperty | Where-Object {$_.DisplayName -match "^Java \d Update \d{3}.*$" } | Select-Object -Property DisplayName, UninstallString ForEach ($ver in $javaVer) { If ($ver.UninstallString) { $uninst = $ver.UninstallString Start-Process cmd -ArgumentList "/c $uninst /quiet /norestart" -Verb RunAs -Wait } } More on reddit.com
🌐 r/SCCM
47
34
August 28, 2023
How to uninstall Java
I did this to remove Oracle JDK 8. https://www.java.com/en/download/help/mac_uninstall_java.html For OpenJDK it looks like you just have to delete the JDK directory. https://www.codejava.net/java-se/uninstall-jdk-on-macos More on reddit.com
🌐 r/MacOS
2
3
August 6, 2022
how to delete java completely from windows - Stack Overflow
I'm not sure how to fix the issue regarding it being open elsewhere but I'd recommend trying to open task manager to close Java that way. As for uninstalling it, you can uninstall it as it is an app. More on stackoverflow.com
🌐 stackoverflow.com
🌐
Oracle
java.com › en › uninstall › uninstall_instructions.html
Uninstall instructions for Java
Click Start, point to Settings, and then click the Control Panel. On the Install/Uninstall tab, click the Java version you want to uninstall, and then click Add/Remove.
🌐
Oracle
java.com › en › download › help › uninstaller_toolfaq.html
Information about the Java Uninstall Tool for Windows
The Java Uninstall Tool will be listed. Click Yes to allow the app to run. Yes. The tool can remove versions 1.4.2 and above, on Windows. If you would like to completely remove Java from your computer on other systems, see How do I uninstall Oracle Java on Mac?
Top answer
1 of 9
424
  1. Remove all the Java related packages (Sun, Oracle, OpenJDK, IcedTea plugins, GIJ):

    dpkg-query -W -f='${binary:Package}\n' | grep -E -e '^(ia32-)?(sun|oracle)-java' -e '^openjdk-' -e '^icedtea' -e '^(default|gcj)-j(re|dk)' -e '^gcj-(.*)-j(re|dk)' -e '^java-common' | xargs sudo apt-get -y remove
    sudo apt-get -y autoremove
    
  2. Purge config files (careful. This command removed libsgutils2-2 and virtualbox config files too):

    dpkg -l | grep ^rc | awk '{print($2)}' | xargs sudo apt-get -y purge
    
  3. Remove Java config and cache directory:

    sudo bash -c 'ls -d /home/*/.java' | xargs sudo rm -rf
    
  4. Remove manually installed JVMs:

    sudo rm -rf /usr/lib/jvm/*
    
  5. Remove Java entries, if there is still any, from the alternatives:

    for g in ControlPanel java java_vm javaws jcontrol jexec keytool mozilla-javaplugin.so orbd pack200 policytool rmid rmiregistry servertool tnameserv unpack200 appletviewer apt extcheck HtmlConverter idlj jar jarsigner javac javadoc javah javap jconsole jdb jhat jinfo jmap jps jrunscript jsadebugd jstack jstat jstatd native2ascii rmic schemagen serialver wsgen wsimport xjc xulrunner-1.9-javaplugin.so; do sudo update-alternatives --remove-all $g; done
    
  6. Search for possible remaining Java directories:

    sudo updatedb
    sudo locate -b '\pack200'
    

    If the command above produces any output like /path/to/jre1.6.0_34/bin/pack200 remove the directory that is parent of bin, like this: sudo rm -rf /path/to/jre1.6.0_34.

2 of 9
51

To completely remove OpenJDK on Ubuntu 11.10 (this may or may not be sufficient on other versions of Ubuntu), run:

sudo apt-get purge openjdk-\* icedtea-\* icedtea6-\*

If you want instructions for removing the proprietary Oracle ("Sun") version of Java, then you'll have to specify how you installed it. (If you edit your question to indicate this and leave a comment to this answer, I'll try to add information about how to remove that too.)

🌐
MacPaw
macpaw.com › how to › optimization › apps
How to uninstall Java on Mac step by step
February 8, 2026 - If you don’t have the Java installer, you can download it here. When the installer opens, type in your Mac admin password. Click Remove and wait for it to uninstall.
Find elsewhere
🌐
Oracle
java.com › en › download › help › linux_uninstall.html
How do I uninstall Java for Linux?
For example, if you used RPM to install Java, then use the RPM uninstall method.
🌐
Oracle
java.com › en › uninstall
Uninstall Index
Keeping out-of-date versions of Java on your system may present a serious security risk. To help you remove out-of-date Java installations, we have created a Java Uninstall Tool.
🌐
MiniTool Partition Wizard
partitionwizard.com › home › partition manager › how to uninstall java? here are three methods for you
How to Uninstall Java? Here Are Three Methods for You - MiniTool Partition Wizard
July 7, 2023 - To remove Java with Control Panel, you just need to follow the steps below. Step 1: Press Win + S to open the Windows Search utility. Then search for Control Panel and open it. Step 2: Choose View by: Category from the upper right corner.
🌐
Oracle
java.com › mac_uninstall_faq
How do I uninstall Java on my Mac?
Note: To uninstall Java, you must have Administrator privileges and execute the remove command either as root or by using the sudo tool.
🌐
Reddit
reddit.com › r/sccm › remove java from all systems.
r/SCCM on Reddit: Remove Java from ALL systems.
August 28, 2023 -

Hello i have been recently tasked with a plan and execute the removal of java from all systems in our environment. The previous person was attempting to complete this through a series of task Sequences in SCCM but was not very successful. Are there any scripts to complete this task and should it be completed by task sequence?

🌐
Reddit
reddit.com › r/macos › how to uninstall java
r/MacOS on Reddit: How to uninstall Java
August 6, 2022 -

I installed several versions of the JDK, both official and open source. But I no longer need them. How exactly do you "uninstall" Java on macOS?

The best I can figure is just to go into HD/Library/Java and just delete everything there. Slightly new to macOS so wondering if this is right. The installers themselves don't give any means of uninstalling.

🌐
wikiHow
wikihow.tech › computers and electronics › operating systems › mac › how to remove java: macos uninstallation guide and tips
How to Remove Java: MacOS Uninstallation Guide and Tips
January 17, 2026 - Learn how to completely remove Java from your Mac systemKeeping old Java versions installed on your Mac desktop or MacBook can lead to security vulnerabilities. Uninstalling Java from macOS might look intimidating—but the process is pretty...
🌐
YouTube
youtube.com › watch
How to Uninstall Java from Windows 11 - YouTube
**Title: How to Uninstall Java from Windows 11 | Step-by-Step Removal Guide****Description: If you're looking to remove Java from your Windows 11 system, our...
Published   October 26, 2023
🌐
Tutorials24x7
tutorials24x7.com › java › how-to-uninstall-java-from-windows
How To Uninstall Java From Windows | Tutorials24x7
May 2, 2020 - We can completely remove Java from the Windows system by uninstalling all the versions using the steps mentioned in this section. The steps should be the same for Java 8, Java 9, Java 10, Java 11, Java 12, Java 13, and Java 14 installed using the installer. You might have also installed JRE while installing Java 8, Java 9, and Java 10. This section also provides the steps to uninstall JRE for Java 8, Java 9, and Java 10.