# How to uninstall Java on Mac

> Uninstall Oracle Java on a Mac with the three Terminal commands Oracle gives, and why you shouldn't touch the java tools in /usr/bin.

Source: https://macblaze.space/uninstall/java (updated 2026-11-29)

To uninstall Oracle Java on a Mac, run three commands in Terminal as an administrator to remove the Java plug-in, the Java Control Panel and Java's support folder. Oracle warns not to remove the java tools in /usr/bin, which belong to macOS.

## Steps

Open **Terminal** (Applications → Utilities) and run these three commands from Oracle, one at a time. Each asks for your administrator password.

`sudo rm -fr /Library/Internet\ Plug-Ins/JavaAppletPlugin.plugin`

`sudo rm -fr /Library/PreferencePanes/JavaControlPanel.prefPane`

`sudo rm -fr ~/Library/Application\ Support/Oracle/Java`

Oracle also recommends clearing the Java Deployment Cache afterwards.

## Don't touch /usr/bin

Oracle says not to try uninstalling Java by removing the java tools in /usr/bin. That folder is part of macOS, and Apple restores it with the next system update.

## JDKs are separate

These steps remove Oracle's Java runtime. If you installed a JDK for development, it usually lives in /Library/Java/JavaVirtualMachines, one folder per version. Check which versions you have before removing any, since other tools may depend on them.

## Remove it and its leftovers in one go

Dragging Java to the Trash leaves its support files behind. MacBlaze's uninstaller finds the caches, settings and support files an app leaves, shows how much each part takes before you remove it, and moves everything to the Trash, so you can still put something back.

## Questions

### Do I need administrator rights?
Yes. Oracle says the remove commands must run as root or with sudo.

### Can I delete java from /usr/bin?
No. Oracle warns that folder is part of macOS and any change is reset by Apple's next update.

### Does this remove the JDK?
These commands remove Oracle's Java runtime, plug-in and control panel. Development JDKs are installed separately.

### Do I need Java on a Mac?
Only if an app you use requires it. Most Mac apps don't.

## Related
- [Uninstall Python on Mac](https://macblaze.space/uninstall/python)
- [Uninstall Docker Desktop on Mac](https://macblaze.space/uninstall/docker)
- [Docker and Xcode taking up space](https://macblaze.space/guides/docker-xcode-taking-up-space-mac)
