How to Uninstall Java on a Mac

Java is known for its security flaws — to this day, over a hundred vulnerabilities have been identified. The good news is that unless you’re running an application that requires Java or visiting websites that use the language, you don’t really need it on your computer. You can uninstall Java on a Mac using MacKeeper's Smart Uninstaller.

System Requirements: macOS 10.11 or later

60+ million downloads

i

AV-TEST certified

AV-TEST is an independent lab that checks the effectiveness of antivirus apps against real malware samples.

i

Notarized by Apple

Notarization by Apple is a security measure to check if software is free from malicious components.

i

Trustpilot is an independent digital platform that hosts insightful and honest consumer reviews.

How to Uninstall Java on a Mac
Written by   Ruslana Lishchuk
Updated: September 11, 2025

A note from our experts

 

When you remove apps from your Mac, it’s crucial to remove all their leftovers. To remove Java, we recommend using MacKeeper’s Smart Uninstaller. Our tool quits memory-draining apps, removes plugins, browser extensions, and leftover files in a few clicks.

 

Here’s how to use MacKeeper’s Smart Uninstaller:

  1. Download and install MacKeeper.
  2. Run MacKeeper and select Smart Uninstaller from the left pane.
  3. Click the Start Scan button.
  4. Check the list with the files to remove. Select what to delete and click Remove Selected.
To uninstall Java from your Mac, run Mackeeper and select Smart Uninstaller, then click Start Scan.
Step 1. MacKeeper > Smart Uninstaller > Start Scan
Let Mackeeper scan your Mac. It may take a while.
Step 2. The app scans your Mac
Choose the files and apps you want to delete and click Remove Selected.
Step 3. Choose items to delete > Remove Selected
Click Remove in a pop-up to confirm the deletion.
Step 4. Click Remove

Uninstall Java using Terminal

The most straightforward way to remove Java from a Mac is by using the Terminal command line. Before you do anything, make sure you have administrator privileges on your computer, which enables you to make changes to the system. Once you know you’re an admin, use the following instructions to delete any version of Java.

 

How to remove Java from a Mac with Terminal step-by-step:

  1. Go to Finder and open Terminal by following Applications > Utilities >Terminal
  2. Copy and paste the following commands in the Terminal line:
    • sudo rm -fr /Library/Internet\ Plug-Ins/JavaAppletPlugin.plugin
    • sudo rm -fr /Library/PreferencePanes/JavaControlPanel.prefPane
    • sudo rm -fr ~/Library/Application\ Support/Oracle/Java
  3. 3. Hit Enter.
  4. 4. Enter your user account password and press Enter again.
To remove Java with sudo command in the Terminal, open the app and and paste the following commands in the Terminal line: sudo rm -fr /Library/Internet\ Plug-Ins/JavaAppletPlugin.plugin sudo rm -fr /Library/PreferencePanes/JavaControlPanel.prefPane sudo rm -fr ~/Library/Application\ Support/Oracle/Java

Restore Apple Java after uninstalling

You can reinstall Java 7 and later versions on a Mac by using the link on the official Java website. The recommended version is Java 8 — it’s important to keep the application updated to minimize security threats. Make sure that you have:

  • Admin privileges
  • A fast 64-bit browser such as Safari
  • Intel core
  • macOS 10.7.3 and above

What to do after downloading the installer:

  1. Make sure you downloaded the correct file. For the latest version of Java 8, it’s jre-8u65-macosx-x64.pkg.
  2. Double-click on the file to open it.
  3. Double click on the icon to launch the Wizard.
  4. Click past the windows until the installation is launched.
  5. Wait until the process is complete and move the Install Wizard to Trash.

Unfortunately, there are still no certified versions of Java and JDK for macOS Catalina. This is due to stricter security checks by Gatekeeper. You can modify your security preferences to install non-notarized software such as Java and JDK, but beware of the risks that it takes.

Uninstall JDK

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.

 

JDK uninstallation process:

  1. First, check if there’s a JDK in your directory. Copy and paste cd /Library/Java/JavaVirtualMachines and press Enter to open it.
  2. Type in ls and press Enter to see the contents of the directory.
  3. If you see a jdk file, use the rm prompt to delete it. Type in sudo rm -rf jdk1 and press the Tab key to complete the command.
  4. Press Enter to erase the file.
To uninstall JDK via Terminal, enter sudo rm -rf jdk1and press the Tab key to complete the command.

Make sure Java is gone

You can check that JDK is fully erased from your computer by typing in java in the Terminal command line and pressing Enter. The message “No Java runtime present, requesting install” indicates success.

To be sure Java is uninstalled from your Mac, enter injava in the Terminal command line and press Enter. There should be a pop-up No Java runtime present, requesting install

Check that you’re deleted Java on a Mac in System Preferences. If the Java icon is gone from the bottom pane, you have uninstalled the software.

FAQ

How do I download Java Kit for Mac?

You can find and download a Java development kit for macOS on JDK’s official website. However, bear in mind that you must use a 64-bit browser.

Should I uninstall Java?

You should always keep all of your software and applications up to date and uninstall the items that you don’t use. If you don’t utilize apps and websites that run on Java, we recommend you uninstall it.

How do I know if Java is installed on my Mac?

To check if your Mac has Java, go to the Apple menu in the top left corner of the screen and open System Preferences. If you don’t see a Java icon in the bottom pane, Java 7 or later is not installed on your computer.

 

Alternatively, you can type in java -version in the Terminal command line to see the information about the version of Java currently installed on your Mac. If there is no Java, you will get a “No Java runtime present” message.

Is Java safe for Mac?

Java does impose some security threats for users of all operating systems. However, the risk diminishes if you keep the software up to date. If you’ve decided to download Java on your Mac, make sure to only use the official website.

 

Read more:

Use your Mac to the fullest! Sign up and get:
Effective tips on how to fix Mac issues
Reliable advice on how to stay safe online
Mac-world news and updates

Thank you!

You’ll love exploring your Mac with us.

Oops, something went wrong.

Try again or reload a page.

Here’s another sign you need to upgrade your macOS ASAP:

30% off your MacKeeper subscription

Сopy the code now and use it in the MacKeeper checkout after the upgrade.

Copy Code

Please be aware that this code cannot be combined with any other discounts, offers, or promotions.

Contents

Unlocked
PC

MacKeeper - your all-in-one solution for more space and maximum security.

Try Now

Read more

How to Get Apple ID Verification Code Without Phone
How to Get Apple ID Verification Code Without Phone
How to Install Windows on Mac Using Boot Camp Assistant
How to Install Windows on Mac Using Boot Camp Assistant
arrow

Run Application

step_1

Click Continue

step_2

Click Install

step_1

Your macOS version is lower than OS 10.11. We’d like to offer you MacKeeper 4 to solve the cleaning, privacy, and security issues of your macOS.