Steps I performed were from here : https://www.java.com/en/download/help/mac_uninstall_java.html

  1. In the Terminal window Copy, Paste and run the commands below (one by one) :

    sudo rm -fr /Library/Internet\ Plug-Ins/JavaAppletPlugin.plugin
    sudo rm -fr /Library/PreferencePanes/JavaControlPanel.prefPane
    sudo rm -fr ~/Library/Application\ Support/Oracle/Java
    
    
  2. Then after successfully uninstalling Java, you may remove Java Deployment cache: In the Terminal window Copy and Paste the commands below:

    rm -r ~/"Library/Application Support/Oracle/Java"
    
  3. then remove the jdk folder and it's content:

    sudo rm -r -f /Library/Java/JavaVirtualMachines/jdk<"your_version">.jdk
    
  4. then perform the holy computer restart .

If you have more than 1 java version installed you may also find useful the info from this page: https://java.tutorials24x7.com/blog/how-to-switch-java-version-on-mac

Answer from user18091415 on Stack Overflow
๐ŸŒ
Oracle
java.com โ€บ en โ€บ download โ€บ help โ€บ uninstall_java.html
How do I uninstall Java on my Windows computer?
The Add/Remove control panel displays a list of software on your system, including any Java software products that are on your computer. Select any that you want to uninstall by clicking on it, and then click the Remove button.
๐ŸŒ
Oracle
java.com โ€บ en โ€บ uninstall โ€บ uninstall_instructions.html
Uninstall instructions for Java
The Add/Remove control panel displays a list of software on your system, including any Java software products that are on your computer. Select any that you want to uninstall by clicking on it, and then click the Remove button.
Discussions

How can I remove java 17 and java 20 from Arch?
The package names to remove are jdk17-openjdk and jdk-openjdk and jre-openjdk{,-headless} and jre17-openjdk{,-headless} respectively More on reddit.com
๐ŸŒ r/archlinux
5
3
September 6, 2023
how to delete java completely from windows - Stack Overflow
I have messed up my windows java installation and i want to delete everything and re-install java , all of my java versions have been messed up and I don't know what to do in this situation when I ... More on stackoverflow.com
๐ŸŒ stackoverflow.com
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
macos - How to uninstall java from mac completely? JRE and JDK - Stack Overflow
$ brew list | grep -iE 'java|jdk|temurin' openjdk openjdk@17 openjdk@8 ยท If I wanted to remove all of them, I could do brew uninstall them one by one, or: More on stackoverflow.com
๐ŸŒ stackoverflow.com
Top answer
1 of 3
5

Steps I performed were from here : https://www.java.com/en/download/help/mac_uninstall_java.html

  1. In the Terminal window Copy, Paste and run the commands below (one by one) :

    sudo rm -fr /Library/Internet\ Plug-Ins/JavaAppletPlugin.plugin
    sudo rm -fr /Library/PreferencePanes/JavaControlPanel.prefPane
    sudo rm -fr ~/Library/Application\ Support/Oracle/Java
    
    
  2. Then after successfully uninstalling Java, you may remove Java Deployment cache: In the Terminal window Copy and Paste the commands below:

    rm -r ~/"Library/Application Support/Oracle/Java"
    
  3. then remove the jdk folder and it's content:

    sudo rm -r -f /Library/Java/JavaVirtualMachines/jdk<"your_version">.jdk
    
  4. then perform the holy computer restart .

If you have more than 1 java version installed you may also find useful the info from this page: https://java.tutorials24x7.com/blog/how-to-switch-java-version-on-mac

2 of 3
1

You can try removing Java from your system with these commands

rm will remove the specified file or directory.

options -r If it's a directory, it will remove all its contents recursively, including subdirectories/files and their contents. -f Do this forcefully without asking for confirmation for each files and folders.

sudo rm -rf /Library/Java/JavaVirtualMachines/jdk[version].jdk

Example:

sudo rm -rf /Library/Java/JavaVirtualMachines/jdk-17.jdk

Additional Files/Folders

sudo rm -rf /Library/PreferencePanes/JavaControlPanel.prefPane
sudo rm -rf /Library/Internet\ Plug-Ins/JavaAppletPlugin.plugin
sudo rm -rf ~/Library/Application\ Support/Oracle/Java
๐ŸŒ
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.
๐ŸŒ
Azul
docs.azul.com โ€บ core โ€บ uninstall โ€บ other-distributions
Uninstalling other OpenJDK distributions
# Check all the installed packages $ sudo apt list --installed # Uninstall example, depending on the installed package, for example 'openjdk-17-jre' $ sudo apt remove openjdk-17-jre # To remove the package including all its files and configuration files, instead use $ sudo apt purge openjdk-17-jre ...
๐ŸŒ
Oracle
java.com โ€บ en โ€บ download โ€บ help โ€บ mac_uninstall_java.html
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.
Find elsewhere
๐ŸŒ
Oracle
java.com โ€บ en โ€บ download โ€บ help โ€บ linux_uninstall.html
How do I uninstall Java for Linux?
There are two ways to uninstall Java. Please use the method that you used when you installed Java.
๐ŸŒ
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.

๐ŸŒ
Nektony
nektony.com โ€บ home โ€บ blog โ€บ how to uninstall java on a mac completely
How to uninstall Java on Mac - Detailed steps
July 14, 2025 - It is an uninstall tool for Mac designed to remove various applications, programs, and its remaining files in just a few clicks without a risk of error. Java is a popular programming language and open-source platform used to build cross-platform applications. It powers everything from business tools to web services, often through the Java Development Kit (JDK) or Java Runtime Environment (JRE). ... According to a 2024 report by New Relic, Java 17 ...
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.)

๐ŸŒ
Oracle
java.com โ€บ en โ€บ download โ€บ help โ€บ uninstaller_toolfaq.html
Information about the Java Uninstall Tool for Windows
The tool checks to see if there are Java versions that can be removed. If there are none, you will see a message that there are no versions of Java on your computer, otherwise you will be presented with a list of versions and if you click Uninstall Selected Versions, the process to remove them begins.
๐ŸŒ
MacKeeper
mackeeper.com โ€บ blog โ€บ mac tutorials โ€บ how to uninstall java on a mac
How to Uninstall Java on a Mac
September 24, 2025 - Step 1. MacKeeper > Smart Uninstaller ... Click Remove ยท The most straightforward way to remove Java from a Mac is by using the Terminal command line....
๐ŸŒ
Oracle
java.com โ€บ olderversions
Why should I uninstall older versions of Java from my system?
Windows: You can uninstall versions of Java manually in the same way as you would uninstall any other software from your Windows computer. Follow the instructions on manually uninstalling Java for Windows.
๐ŸŒ
CodeJava
codejava.net โ€บ java-se โ€บ uninstall-jdk-from-windows
How to Uninstall JDK from Windows
October 30, 2021 - You can type where java in command prompt to know the installation directory:Then change the current directory to OpenJDK directory and type the following command: ... You can also press Shift + Delete on a folder in Windows explorer. In case you could not find uninstaller for Oracle JDK, you ...
๐ŸŒ
UConn
kb.uconn.edu โ€บ space โ€บ IKB โ€บ 10733127448 โ€บ Uninstalling+Java+on+Mac
Uninstalling Java on Mac - Information Technology - UConn Knowledge Base
sudo rm -fr /Library/Internet\ Plug-Ins/JavaAppletPlugin.plugin sudo rm -fr /Library/PreferencePanes/JavaControlPanel.prefPane sudo rm -fr ~/Library/Application\ Support/Java ยท Do not attempt to uninstall Java by removing the Java tools from /usr/bin.
๐ŸŒ
MacPaw
macpaw.com โ€บ how to โ€บ optimization โ€บ apps
How to uninstall Java on Mac step by step
February 8, 2026 - Paste the commands below, one at ... Support/Oracle/Java ... The easiest way to uninstall Java is to use an application designed to uninstall apps completely....