I was able to unistall jdk 8 in mavericks successfully doing the following steps:

Run this command to just remove the JDK

sudo rm -rf /Library/Java/JavaVirtualMachines/jdk<version>.jdk

Run these commands if you want to remove plugins

sudo rm -rf /Library/PreferencePanes/JavaControlPanel.prefPane
sudo rm -rf /Library/Internet\ Plug-Ins/JavaAppletPlugin.plugin
sudo rm -rf /Library/LaunchAgents/com.oracle.java.Java-Updater.plist
sudo rm -rf /Library/PrivilegedHelperTools/com.oracle.java.JavaUpdateHelper
sudo rm -rf /Library/LaunchDaemons/com.oracle.java.Helper-Tool.plist
sudo rm -rf /Library/Preferences/com.oracle.java.Helper-Tool.plist
Answer from Samuel Alpoim on Stack Overflow
Top answer
1 of 2
134

You can get official oracle instruction to remove java from macOS here

In your macOS terminal type this one by one

Copysudo rm -fr /Library/Internet\ Plug-Ins/JavaAppletPlugin.plugin 
sudo rm -fr /Library/PreferencePanes/JavaControlPanel.prefPane 
sudo rm -fr ~/Library/Application\ Support/Oracle/Java


After that you can navigate to specific version of java that you intend to delete by using the following command:

Copycd /Library/Java/JavaVirtualMachines

Then type ls in your terminal to list down all the Java Virtual Machine Folders.
Finally add the version number you want to delete like this

sudo rm -rf jdk-10.0.1.jdk

Instead of jdk-10.0.1.jdk you can give any version number which are listed down in your above mentioned folder.

2 of 2
9

Update:

  1. First remove the java runtime

    Copy$ sudo mv /Library/Internet\ Plug-Ins/JavaAppletPlugin.plugin ~/
    $ sudo mv /Library/PreferencePanes/JavaControlPanel.prefpane ~/
    

    Now you can close and reopen the System Preferences window to see that the icon is gone.

  2. Next, uninstall the Java JDK. Open a terminal and change to the Java directory:

    Copy$ cd /Library/Java/JavaVirtualMachines
    

    You can use ls at the prompt to see what is in the directory and copy the jdk's path name with version number that you wish to delete.

    Copy$ ls --directory *jdk*
    examplejdk-7.jdk
    

    Copy the exact name of the path you want to remove -- for this example it's examplejdk-7.jdk. Next, use that path name inside of single quotes ('examplejdk-7.jdk') to move it to your desktop. Instead of deleting the directory, this moves it to your desktop so you can restore it later in case there's an issue!

    Copy$ sudo mv 'examplejdk-7.jdk' ~/
    
  3. To confirm that it has been removed, run this command:

    Copy$ java
    

    This should output an error message:

    No Java runtime present, requesting install
    
Discussions

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
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 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
How to uninstall JDK on Mac OS?
Navigate to /Library/Java/JavaVirtualMachines and remove the directory whose name matches the following format: /Library/Java/JavaVirtualMachines/jdkmajor.minor.macro[_update].jdk More on github.com
🌐 github.com
2
December 1, 2020
🌐
Oracle
java.com › mac_uninstall_faq
How do I uninstall Java on my Mac?
This directory is part of the system ... ... To uninstall JDK 7 and later versions, you must have Administrator privileges and execute the remove command either as root or by using sudo....
🌐
CleanMyMac
cleanmymac.com › blog › uninstall-java-jdk-mac
How to uninstall JDK and Java on Mac
February 27, 2025 - While you can delete Java manually, the process involves searching for system files and ensuring all traces are removed. Below, we'll show you how to uninstall Java on Mac using a built-in removal method, a manual cleanup, and a much easier alternative method.
🌐
Lehigh Computer Science
docs.cse.lehigh.edu › java › removing-java-mac
Removing Versions of Java on Mac OS - Lehigh Computer Science Docs
if [[ -d /Library/Java/JavaVirtualMachines/jdk1.8.0_181.jdk/ ]]; then \ sudo rm -rf /Library/Java/JavaVirtualMachines/jdk1.8.0_181.jdk/; fi · The above is just an example, substitute each of the folder names returned from the previous command. Mac OS will prompt for an administrative user password. Proceed with removing the JavaAppletPlugin.plugin location:
🌐
CodeJava
codejava.net › java-se › uninstall-jdk-on-macos
How to Completely Uninstall JDK on macOS
April 29, 2022 - Open a terminal window, and type which java to see all locations pointing to the java program - it gives you some clues about where the JDK installation directory is.The simply type the following command to completely uninstall OpenJDK from macOS: rm -rf Path/To/OpenJDKIf you got permission ...
Find elsewhere
🌐
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 - The best way to uninstall Java on macOS is via the Terminal, using the remove command. If you still have the installer for your version of Java, you can use it to uninstall Java. Use the Terminal to remove the JDK (if you have it) and the Java ...
🌐
Nektony
nektony.com › home › blog › how to uninstall java on a mac completely
How to uninstall Java on Mac - Detailed steps
July 14, 2025 - https://www.codejava.net/java-se/uninstall-jdk-on-macos · In our experience, using Terminal commands or a dedicated Java uninstall tool like App Cleaner & Uninstaller can help force a complete and safe removal.
🌐
MacKeeper
mackeeper.com › blog › mac tutorials › how to uninstall java on a mac
How to Uninstall Java on a Mac
September 24, 2025 - For the latest version of Java 8, it’s jre-8u65-macosx-x64.pkg. Double-click on the file to open it. Double click on the icon to launch the Wizard. Click past the windows until the installation is launched.
🌐
Mac Install Guide
mac.install.guide › java › uninstall
Uninstall Java on Mac · Mac Install Guide · 2026
The process differs depending on whether you installed Java manually, via Homebrew, or through a version manager like SDKMAN or mise. Java installations on Mac leave files across multiple system locations. A complete uninstallation may require removing the main JDK directories, vendor-specific components, cached files, and shell configuration entries.
🌐
javathinking
javathinking.com › blog › how-to-uninstall-java-from-mac-completely-jre-and-jdk
How to Uninstall Java Completely from Mac (JRE & JDK): Fix OpenJDK Still Showing in Terminal — javathinking.com
This guide will walk you through a step-by-step process to completely remove Java (including OpenJDK, Oracle JDK, and JRE) and fix common issues like lingering Java versions in the terminal. ... Before uninstalling, confirm which Java versions (JRE/JDK) are installed on your Mac.
🌐
iMyMac
imymac.com › powermymac › uninstall adoptopenjdk on mac: follow these steps
Uninstall AdoptOpenJDK on Mac: Follow These Steps
August 12, 2024 - Then you will see the information. If you can see the text 8.0_06, for example, from the strings, then the version is 8u6 · To remove 8u6, use the command: % rm -rf jdk1.8.0_06.jdk
🌐
GitHub
github.com › halyph › mind-flow › issues › 136
How to uninstall JDK on Mac OS? · Issue #136 · halyph/mind-flow
December 1, 2020 - ref: https://docs.oracle.com/javase/8/docs/technotes/guides/install/mac_jdk.html Uninstalling the JDK To uninstall the JDK, you must have Administrator privileges and execute the remove command either as root or by using the sudo(8) tool...
Author   halyph
🌐
iBoysoft
iboysoft.com › home › how to tips › how to completely uninstall java on macos [full guide]
Java macOS Uninstall with Top 4 Ways [Complete Removal]
November 27, 2025 - Java macOS uninstall is easy to realize through its installer file, Finder, Terminal, and CleanMyApp. But CleanMyApp is the only one to remove Java completely from Mac the most quickly and easily for the app and the leftovers.
🌐
Reddit
reddit.com › r/mac › how to delete java on macbook m2?
r/mac on Reddit: How to delete Java on Macbook M2?
October 5, 2024 -

I downloaded the ARM64 DMG Installer from Oracle for a quick task, now I want to delete Java, but I can't locate it, in ~/Library/ there are no Java files.

How can I delete it?

your help is greatly appreciated

(extra: DMG source https://www.oracle.com/jo/java/technologies/downloads/#jdk23-mac)

🌐
MacPaw
macpaw.com › how to › optimization › apps
How to uninstall Java on Mac step by step
February 8, 2026 - The easiest way to uninstall Java is to use an application designed to uninstall apps completely. We recommend CleanMyMac. It will track down all the files an application has placed on your Mac and remove them, leaving no trace of the app on ...