July 14, 2025
How to uninstall Java on a Mac completely
Stuck trying to delete Java versions from your Mac? You’re in the right place. We’re here to help you go all the way with your Java uninstallation attempts 😉.
In this step-by-step guide, we come up with four options and possible workarounds on how to remove Java from a Mac entirely.
This article contains:
Before you dive in…
Delete Mac apps quickly and reliably using App Cleaner & Uninstaller. 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.
What is Java?
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).
Interesting fact:
According to a 2024 report by New Relic, Java 17 became the most popular LTS version with 35.4% adoption rate, nearly 3 times higher than in 2023 (9.1%) which means that 35.4 % of applications are now using Java 17 in production, followed by Java 11 at 32.9%, then Java 8 at 28.8%. Another research reveals Java 24 early adoption rate: 23% of enterprises.
Video Guide: How to Delete Java on macOS
1:39
Do I need Java on my Mac?
Although Java has been around for 29 years as of 2025, it’s still widely used in development, with over 90% of Fortune 500 companies relying on it.
However, even if you’re building apps using the JDK or working in a Java-based development environment, you might still decide to:
- Switch to another language – you may be moving to Swift, Python, or JavaScript and no longer need Java.
- Fix compatibility issues – you may need to remove it to prevent any potential conflicts with other software.
- Clean up older versions – for instance, you installed the beta and now want to change the version.
Also, you might want to uninstall Java for:
- Security risks: Java has a history of security vulnerabilities, making it a potential target for cyberattacks and malware. One of the most common threats, SQL injections, gives hackers access to your queryable information. This can potentially let them steal, destroy, or corrupt your database. In this case, you might need to uninstall MySQL on your Mac.
- System slowdowns: Java can hog memory and drag performance down. Background Java processes can consume memory and CPU, which might be one of the reasons that slow your Mac down.
- Accidental installation: Sometimes Java comes bundled with other apps. If you didn’t install it intentionally, it’s safe to remove.
Options to delete Java from Mac
Whatever the reason, we are at your service to help you figure out how to uninstall Java safely and completely. While Java offers its official uninstallation method, however, it does not delete the app entirely, but leaves a bunch of remnants generated after installation.
That’s why we prepared the main methods to fully delete Java so you can choose the one that best fits your situation and comfort level. Here is the comparison:
Method | Time spent | Removes Hidden Files | Risk of Mistakes | Recommended When… |
---|---|---|---|---|
Manual (System Settings) | 10+ min | ❌ No | ❓Medium | You have the patience to dig into folders on your own |
Installer Method | 10+ min | ❌ Partial | ❓Medium | You have the original .pkg file |
Terminal Commands | 10+ min | ✅ Yes (with care) |
❌ High | You’re comfortable using Terminal |
Before diving into Java uninstallation methods, keep in mind that we compiled this guide by testing it with Java 8 Update 451 on macOS Sequoia 15.3.1.
How to delete Java manually from System Settings
Java isn’t a typical app, so you won’t find it in your Applications or Launchpad. Instead, you can locate it through System Settings. Here is how to find it:
- Click on the Apple icon from the Apple menu in the top-left corner of the screen.
- Select the System Settings from the dropdown list.
- Scroll down the System Settings list of the sidebar and Locate Java at the bottom of the sidebar list → control-click on it.
- Select the Remove Java Settings pane.
- Remove leftover files manually. For this, open Finder → press Cmd + Shift + G →in the Go to Folder field, enter each of the following directories one by one, hit Return → delete any Java related files, if any:
In the Go to Folder field, enter each of the following directories one by one, hit Return → delete any Java-related files, if any:
Main
/Library/Internet Plug-Ins/JavaAppletPlugin.plugin
Copy
Caches
→ remove any files starting with com.oracle/private/var/db/receipts/
Copy
→ delete everything containing java in its name~/Library/Caches/
Copy
~/Library/Saved Application State/net.java.openjdk.cmd.savedState
Copy
~/Library/Caches/Oracle.MacJREInstaller
Copy
~/.oracle_jre_usage
Copy
→ go to your temporary user data short-named folder (e.g. v4, 21) → open the very long alphanumeric folder (example for reference: 1n42g35d31v8bjztscsn5dmm0000gn) → navigate to the C/ subfolder → delete Com.oracle.java.8u451.java and Oracle.MacJREInstaller./private/var/folders/
Copy
→ trash anything prefixed with com.oracle.java~/Library/Caches/
Copy
Library
→ locate and delete Java folder/Library/
Copy
Application Support
~/Library/Application Support/Oracle/Java
Copy
/Library/Application Support/Oracle/Java
Copy
~/Library/Application Support/JREInstaller
Copy
/Library/Application Support/JREInstaller
Copy
~/Library/HTTPStorages/Oracle.MacJREInstaller
Copy
~/Library/Preferences/com.apple.java.util.prefs.plist
Copy
→ delete Oracle.MacJREInstaller and files containing com.oracle.java in the name~/Library/HTTPStorages/
Copy
Preferences
→ delete files matching the prefix com.oracle.java~/Library/Preferences/
Copy
/Library/Preferences/com.oracle.java.Helper-Tool.plist
Copy
Logs
/private/var/log/jreinstall.log
Copy
- Empty the Trash.
- Locate the Java .dmg file in your Downloads folder.
- Click on the installer.
- Run the Java installation file.
- Enter your Mac admin password, if permission is required to continue.
- Click on the Remove button.
You’ll get a message confirming Java has been removed.
- Clean up leftovers as per step 5 in the How to delete Java manually from System Settings section.
- Empty your Trash.
- Run Terminal from the Applications folder → Utilities.
- Remove the Java Control Panel by entering this command in Terminal:
sudo rm -rf /Library/PreferencePanes/JavaControlPanel.prefPane
Copy
Note:
Before proceeding with the next move, remember that the following Java leftovers deletion script only deletes Java-related files and folders generated during installation and runtime. It does not impact any other apps or system components on your Mac.
-
Erase any Java-associated files: download the Java uninstallation script → activate it in Terminal using the commands below one after another:
chmod +x ~/Downloads/script_remove_java.sh ~/Downloads/script_remove_java.sh
Copy
That’s it. You nailed it 😎
Heads up for Java 9+ versions: Newer Java versions (9-24) are of a more consolidated structure. Don’t be surprised if you don’t see a Java Preference Pane or if there are fewer files to delete compared to Java 8. This reduced footprint is normal for these modern installations.
Note:
As you see, it’s easy to miss residual files in manual uninstallation. So, don’t hesitate to use a reliable uninstaller tool such as App Cleaner & Uninstaller. It scans and deletes the full remaining files of apps dragged to the Trash. And of course, the tool can uninstall apps in four clicks, catching all of its data: open the tool → select app → click uninstall → confirm.
How to uninstall Java using its installation file
Next, you can uninstall Java on macOS with its installer. This method works if the installer is still available and you didn’t delete it after installation. If so, our tip here is that you can download the installation file again from Oracle’s site, but make sure you are about to download the same version as installed.
Now, let’s assume you have the installer. The Java uninstallation process will look like this:
That’s all. The end 🤗
How to uninstall Java from Mac with Terminal
Another way to uninstall Java on Mac is to use a special command in Terminal. Terminal is a default macOS application that you can find in the Launchpad or in the Applications folder. If you are comfortable using the command line, here is how to delete Java on Mac:
All done. Finito 🤌
Note:
If the System Settings window was open while running the script, you might still see Java in the list. To refresh it, simply close and reopen System Settings after the script procedure.
What if you can’t uninstall Java on Mac? How to fix it?
Sometimes things go wrong, and you just can’t remove Java. Understandable. That’s why we cover some dead-end situations where standard uninstallation methods fail – whether it’s a missing installer, broken links, or leftover files that won’t go away.
Case #1: The issue occurred when uninstalling all Java versions from Mac.
That’s what the user was worried about:
I’ve been trying to uninstall all java versions from my Mac by following:
% cd /Library/Java/JavaVirtualMachines
When I did ls into JavaVirtualMachines, I saw that there are no folders/ java versions available. However, when I do java –version, there is still a OpenJDK installed on my Mac:
openjdk 11.0.17 2022-10-18 LTS
OpenJDK Runtime Environment Corretto-11.0.17.8.1 (build 11.0.17+8-LTS)
OpenJDK 64-Bit Server VM Corretto-11.0.17.8.1 (build 11.0.17+8-LTS, mixed mode)
which java returns /usr/bin/java
Any advice on how I can uninstall this openJDK version?Solution
I solved this issue by installing the Java version manager! For those having the same issue, I followed this guide on how to manage multiple Java versions on macOS, then I didthen ls and corretto-11.0.17 showed up and I was able to remove it using/Library/Java/JavaVirtualMachines/
Copy
.rm -rf corretto-11.0.17
Copy
Case #2: The problem connected with handling several JDK versions and uninstalling Java.
That’s what the user was worried about:
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?
Suggestion
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-macosIn our experience, using Terminal commands or a dedicated Java uninstall tool like App Cleaner & Uninstaller can help force a complete and safe removal.
Final thoughts
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. Moreover, there is Java embedded in the system, other tools, making it trickier to know what can safely be removed.
That’s why having App Cleaner & Uninstaller is so handy, it streamlines the process of removing unnecessary applications, extensions, and junk files. With this tool, you know exactly what you are going to remove, and deleting and managing apps becomes fast, simple, and effortless – like a hack if digging through system folders is not your thing.
If something is still unclear, drop us a line. We will not leave you alone with uninstallation and any other tech problems!