How to uninstall Java on Mac: tips and tricks

A decade or so ago, applications that were developed using Java and needed a Java runtime environment to run on the Mac were fairly common. So common, in fact, that the Java runtime environment was preinstalled in macOS. These days, however, it’s unlikely that you’ll have to use Java, as most Mac apps are written using Apple’s Swift programming language and XCode developer tools. So, if Java is still installed on your Mac, you’ll probably want to uninstall it. We’ll show you how to do that in this article.

What is Java?

Java is both a development platform and a programming language. The platform includes the programming language, along with a compiler, a virtual machine, and a set of libraries. Years ago, lots of software that was made to be compatible on both Windows and Mac was written in Java because it was a simple way to make it work on both systems. While Java is no longer used very much to develop software for the Mac, it’s still in use in embedded systems.

Why uninstall Java on Mac?

It’s good practice to uninstall any software you don’t use. Not only does it free up space, but it also prevents any potential conflicts with other software in the future. As well as that, software which is installed on your Mac but isn’t updated regularly can be a security risk and an opportunity for malware distributors.

How to uninstall Java on Mac

There are a few different ways to uninstall Java on your Mac. Two of them are manual methods and involve either some detective work or using Terminal. The other one is very easy and needs only a couple of clicks. We’ll show you how to do all of them.

Manual removal

  1. If you still have the Java installer, double-click it.
  2. If you don’t have the Java installer, you can download it here.
  3. When the installer opens, type in your Mac admin password.
  4. Click Remove and wait for it to uninstall.
  5. Check System Settings by clicking on the Apple menu and selecting System Settings.
  6. Look at the bottom of the sidebar. If the Java pane is still there, Control-click on it and choose ‘Remove Java Settings pane.’
  7. Click on the Finder icon in the Dock, then the Go menu and choose Go to Folder.
  8. Paste in each of the file paths below, one at a time, pressing Return afterward, and look for files or folders with ‘Java’ in their names. Drag them to the Trash.
    /Library/Application Support/Oracle
    /Library/Java/
    /Library/Internet Plug-ins/
    /Library/PreferencePanes
  9. Empty the Trash

Terminal

  1. Go to Applications > Utilities and double-click Terminal to open it.
  2. Paste the commands below, one at a time, pressing Return after each one, into Terminal:
    sudo rm -fr /Library/Internet\ Plug-Ins/JavaAppletPlugin.plugin
    sudo rm -fr /Library/PreferencePanes/JavaControlPanel.prefPane
    sudo rm -fr ~/Library/Application\ Support/Oracle/Java
    rm -r ~/“Library/Application Support/Oracle/Java”
  3. Quit Terminal

The easy way to uninstall Java from Mac

The easiest way to uninstall Java is to use an application designed for completely uninstalling apps. We recommend CleanMyMac X. It will track down all the files that an application has placed on your Mac and remove them, leaving no trace of the app on your Mac. It can also reset an app to its newly installed state and remove leftovers from applications that weren’t uninstalled properly in the past. You can download it for free here. Once you’ve done that, follow these steps to uninstall Java:

  1. Open CleanMyMac X.
  2. Select Uninstaller in the sidebar.
  3. Use the search bar to search for Java, or locate it in the list on the right pane.
  4. Select it and click Uninstall.
All apps selected in the Uninstaller module of CMMX

If you’ve previously tried to uninstall it, or any other application, and want to check for leftover files and remove them, go to Uninstaller, then click Leftovers in the middle pane. Select the files in the right pane and click Uninstall.

Java is a development environment that includes a programming language, a compiler, runtime environment, and reference libraries. It was once quite common to see applications on the Mac that were written using Java, but it’s rarely used these days. Now, Java is most common in things like embedded systems. So, if you installed it on your Mac and no longer use it, you should uninstall it to free up space and prevent potential problems in the future. Follow the steps above to remove it from Mac manually, using Terminal, or the easy way using CleanMyMac X.

Laptop with CleanMyMac
CleanMyMac X

Your Mac. As good as new.