July 14, 2025

How to uninstall Java on a Mac completely

Sergio Tereshchenko
Written by
A content creator with a background in tech support and quality assurance, focused on writing clear, helpful guides for Mac optimization.

Sergio Tereshchenko

Alex Holovchenko
Approved by
The content has been reviewed and approved by our team member, an Apple Certified Support Professional, who provides technical support to Nektony’s users.

Alex Holovchenko

Share

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.

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%.

Video Guide: How to Delete Java on macOS

1:39

youtube button

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:

  1. Click on the Apple icon from the Apple menu in the top-left corner of the screen.
  2. Select the System Settings from the dropdown list. System Settings option in Mac menu
  3. Scroll down the System Settings list of the sidebar and Locate Java at the bottom of the sidebar list control-click on it.
  4. Select the Remove Java Settings pane. Removing Java settings pane
  5. Remove leftover files manually. For this, open Finder → press Command + Shift + G:

    Going to the Library

  6. 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

      /private/var/db/receipts/ → remove any files starting with com.oracle
      

      Copy

      ~/Library/Caches/net.java.openjdk.cmd

      Copy

      ~/Library/Saved Application State/net.java.openjdk.cmd.savedState

      Copy

      ~/Library/Caches/Oracle.MacJREInstaller

      Copy

      ~/.oracle_jre_usage

      Copy

    • Library

      /Library/ → locate and delete Java folder
      

      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

    • Preferences

      ~/Library/Preferences/→ delete files matching the prefix com.oracle.java
      

      Copy

      /Library/Preferences/com.oracle.java.Helper-Tool.plist

      Copy

    • Logs

      /private/var/log/jreinstall.log

      Copy

  7. Empty the Trash.

That’s it. You nailed it 😎

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.

App Cleaner & Uninstaller window

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:

  1. Locate the Java .dmg file in your Downloads folder.
  2. Click on the installer.
  3. Run the Java installation file.
  4. Java update window
  5. Enter your Mac admin password, if permission is required to continue.
  6. Click on the Remove button. Java uninstall window

    You’ll get a message confirming Java has been removed.

  7. Clean up leftovers as per step 5 in the How to delete Java manually from System Settings section.
  8. Empty your Trash.

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:

  1. Run Terminal from the Applications folder → Utilities.
  2. Remove the Java Control Panelby 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.

  3. Erase any Java-associated files: download the Java uninstallation script → activate it in Terminal using the commands below one after another:

    chmod +x ~/Downloads/remove_java.sh ~/Downloads/remove_java.sh

    Copy

    Terminal app in Applications folder

All done. Finito 🤌

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 did
/Library/Java/JavaVirtualMachines/

Copy

then ls and corretto-11.0.17 showed up and I was able to remove it using
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-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.

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.

If something is still unclear, drop us a line. We will not leave you alone with uninstallation and any other tech problems!

Frequently asked questions

For your convenience, we've also compiled answers to the most common questions about uninstalling Java on Mac - from version-specific steps to resetting settings and clearing the Java cache. We hope these quick tips help you clarify the process and save Christmas 💫

Is there any difference in uninstalling Java depending on the versions?

Yes, there are slight differences:

  1. For Oracle Java 7 and later (including JDKs):
  2. Typically installed in /Library/Java/JavaVirtualMachines/
  3. Can be uninstalled by deleting the specific JDK folder via Terminal:
    sudo rm -rf /Library/Java/JavaVirtualMachines/jdk-<version>.jdk

    Copy

  4. Using the installer (some recent JDKs): Example uninstaller path:
    /Library/Java/JavaVirtualMachines/jdk-<version>.jdk/Contents/Home/Uninstall.tool

    Copy

Version differences also impact file paths and naming.

P.S.: A tool like App Cleaner & Uninstaller can remove all versions regardless of source.

Where is the Java Control Panel on my Mac?

  1. Go to Apple menu → System Settings.
  2. Scroll down and look for Java.
  3. Click to open the Java Control Panel.

How do I reset Java on my Mac?

To reset Java settings:

  1. Open the Java Control Panel.
  2. Under the General tab, click the Setting button → click Restore Defaults.
  3. Optionally, click the Delete Files button to clear the Java cache and temporary files.

To do a total reset of Java:

  1. Launch App Cleaner & Uninstaller.
  2. Locate Java from the Applications list → control-click on it.
  3. Select the Reset Application from the dropdown list → confirm.

How do I clear the Java cache on my Mac?

  1. Open the Java Control Panel. For this, open System Settings → scroll down and look for Java → click to open the Java Control Panel.
  2. In the Java Control Panel, click on Settings under Temporary Internet Files.
  3. Click on the Delete Files button on the Temporary Internet Files window.
  4. This will open the Delete Files and Applications window.
  5. Click OK to confirm the deletion.

How do I disable Java on my Mac?

If you mean disabling Java in your browser, here’s how to do it:

  1. Open System Settings → scroll down the left panel → look for Java and click on it.
  2. Navigate to the Security tab.
  3. Deselect the check box for Enable launching Java Web Start applications from the browser.
Scroll to Top