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
    
🌐
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....
🌐
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 ...
🌐
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:
🌐
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 ...
Find elsewhere
🌐
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.
🌐
javaspring
javaspring.net › blog › macos-uninstall-java-jdk
Uninstalling Java JDK on macOS: A Comprehensive Guide — javaspring.net
Use a Package Manager: If you installed the JDK using a package manager like Homebrew, it's recommended to use the package manager to uninstall it. This ensures that all related files and dependencies are properly removed.
🌐
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.
🌐
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.
🌐
Tutorials24x7
tutorials24x7.com › java › 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.
🌐
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.
🌐
Igor's Blog
igorkromin.net › index.php › 2020 › 12 › 16 › uninstalling-java-on-macos
Uninstalling Java on macOS | Igor Kromin
Using the Terminal.app again, I was able to simply delete the JDKs that I didn't want installed by using the rm command and passing in the Home directory of the JDK to delete (using sudo of course, and entering your admin user password), for ...
🌐
MacPaw
macpaw.com › how to › optimization › apps
How to uninstall OpenJDK: Mac user guide
January 10, 2025 - If you have previously installed OpenJDK on your MacBook and no longer need it, you should remove it. We’ll show you how to uninstall OpenJDK on Mac.
🌐
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)