Skip to main content

How do I uninstall Java on macOS?

To install an older version of Java, you must first uninstall the newer version.

Written by Petr Pech

Not applicable to ABRA Flexi versions 2024.7.0 and earlier. Those versions include Java 11 directly in the installation file and therefore Java cannot be uninstalled.

On macOS, Java cannot be uninstalled through the standard interface — you need to use the Terminal.

Note: To uninstall Java, you must have administrator privileges and run the remove command either as root or using the sudo command.

Remove one directory and one file (symbolic link) as follows:

1. Click the Finder icon in the Dock
2. In the Finder menu, click Go
3. Select Utilities
4. Double-click the Terminal icon
Copy and confirm with Enter — one at a time! — the commands below into the Terminal window:

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

Then confirm it by pressing Enter. Once this command has been executed, copy the next command:

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

Then confirm it again by pressing Enter. Finally, copy the last command to complete the removal:

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

And confirm it again by pressing Enter. By following these steps, you have completely removed all traces of the Java programming language from your macOS system.

Do not attempt to uninstall Java by removing Java tools from /usr/bin. This directory is part of the system software, and Apple will reset any changes made there the next time you perform an operating system update.

Oracle source:

Did this answer your question?