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
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
Discussions

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 uninstall jdk 17 on mac? - Oracle Forums
I installed jdk 17 to realise that 99% of servers don't support jdk 17 only 16 so I tried uninstalling but I couldn't uninstall it. I tried videos, wiki's, oracle wiki & more... More on forums.oracle.com
🌐 forums.oracle.com
October 16, 2021
macos - How to uninstall java from mac completely? JRE and JDK - Stack Overflow
I did navigate to /Library/Java/JavaVirtualMachines and removed the jdk, and there is nothing in that folder anymore. But my terminal shows I have some version of java, so I am a little confused, I... More on stackoverflow.com
🌐 stackoverflow.com
macos - How to remove OpenJDK and go back to regular JDK - Ask Different
I mistakenly installed openJDK and I want to uninstall it and revert back to using regular JDK I had before, how do I do this? I can’t find anywhere how I can I uninstall it and go back to JDK. More on apple.stackexchange.com
🌐 apple.stackexchange.com
June 14, 2021
🌐
Oracle Community
community.oracle.com › tech › developers › discussion › 4490214 › how-to-uninstall-jdk-17-on-mac
How to uninstall jdk 17 on mac? - Oracle Forums
March 21, 2022 - I installed jdk 17 to realise that 99% of servers don't support jdk 17 only 16 so I tried uninstalling but I couldn't uninstall it. I tried videos, wiki's, oracle wiki & more...
🌐
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.

🌐
Oracle
java.com › mac_uninstall_faq
How do I uninstall Java on my Mac?
To uninstall JDK 7 and later versions, you must have Administrator privileges and execute the remove command either as root or by using sudo.
🌐
MacKeeper
mackeeper.com › blog › mac tutorials › how to uninstall java on a mac
How to Uninstall Java on a Mac
September 24, 2025 - You can modify your security preferences to install non-notarized software such as Java and JDK, but beware of the risks that it takes. There can be multiple Java development kits on your Mac, or, more often, none at all. You can uninstall JDK via Terminal with just a few command prompts.
🌐
CodeJava
codejava.net › java-se › uninstall-jdk-on-macos
How to Completely Uninstall JDK on macOS
April 29, 2022 - Then type the following command to remove a JDK installation completely from macOS: sudo rm -rf jdk-versionThis command will be executed under root privilege (password required) - the specified JDK directory will be deleted recursively and forcefully.If you uninstall JDK 1.8, you also need ...
Find elsewhere
🌐
Dev2QA
dev2qa.com › home › how to install / uninstall multiple java versions in mac os by home brew or manually
How To Install / Uninstall Multiple Java Versions In Mac OS By Home Brew Or Manually Windows Tricks
September 12, 2022 - Follow oracle’s documents, to manually uninstall installed JDK in mac os x, you just need to remove some files with root permission in the terminal like below.
🌐
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.
🌐
Nektony
nektony.com › home › blog › how to uninstall java on a mac completely
How to uninstall Java on Mac - Detailed steps
July 14, 2025 - In our experience, using Terminal commands or a dedicated Java uninstall tool like App Cleaner & Uninstaller can help force a complete and safe removal. ... It turned out that removing Java from a Mac can be more complicated than expected, especially when dealing with multiple JDK versions, hidden files, and leftover components.
🌐
Azul
docs.azul.com › core › uninstall › other-distributions
Uninstalling other OpenJDK distributions
# Check all the installed packages ... --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 ...
🌐
Tutorials24x7
java.tutorials24x7.com › blog › how-to-uninstall-java-from-mac
How To Uninstall Java From Mac | Tutorials24x7
April 19, 2020 - # Remove Applet Plugin sudo rm -rf "/Library/Internet Plug-Ins/JavaAppletPlugin.plugin" # Remove JCP sudo rm -rf "/Library/PreferencePanes/JavaControlPanel.prefPane" # Remove Java Files sudo rm -rf "/Library/Application Support/Oracle/Java" # OR sudo rm -rf "/Library/Application Support/Java" # Remove JDKs sudo rm -rf "/Library/Java/JavaVirtualMachines" The above-mentioned commands will uninstall all the Java versions installed on the system as shown in Fig 3. ... Now we can have a clean install of the appropriate version of Java on the Mac system.
🌐
Mac Install Guide
mac.install.guide › java › uninstall
Uninstall Java on Mac · Mac Install Guide · 2026
Remove specific OpenJDK versions. You might have some of these versions: $ brew uninstall openjdk $ brew uninstall openjdk@25 $ brew uninstall openjdk@21 $ brew uninstall openjdk@17
🌐
Oracle
docs.oracle.com › en › java › javase › 17 › install › installation-jdk-macos.html
5 Installation of the JDK on macOS - Java
April 21, 2026 - For example, to uninstall 17 Interim 0 Update 0 Patch 0: ... This topic provides answers for the following frequently asked questions about installing JDK on macOS computers.
🌐
MacPaw
macpaw.com › how to › optimization › apps
How to uninstall Java on Mac step by step
February 8, 2026 - When the installer opens, type in your Mac admin password. Click Remove and wait for it to uninstall.
🌐
Apple Community
discussions.apple.com › thread › 255503582
Uninstalled Java but it still shows up in… - Apple Community
If you are still having trouble uninstalling out-of-date Java versions, you can request further help. ... I have Java 8 Update 401 (latest JRE from January) installed, and the Terminal is unable to notice any versioning on that. Compiled apps for Mac that were built in Java from other developers do not even need this, as those would their JRE built-in. Java 21.x is about the development kit (JDK), not the runtime VM for end user java apps.