How to Uninstall Java on a Mac
Many Mac users don’t need Java on their computer, but if you happen to have Java installed and want to remove it from a Mac then you can uninstall Java and JRE with a little effort.
Uninstalling Java and JRE from the Mac is a little more complicated than installing it, as there is no dedicated uninstaller app or tool, and it’s not as simple as uninstalling other Mac apps since the components are split into different locations. Instead you’ll either turn to the command line, or dig around in the Finder and file system yourself to remove Java in Mac OS. We’ll show you how to remove java using both methods.
Note that by removing Java you will lose the ability to run any and all Java apps or Java dependent apps and applets, either individually, standalone, or via the web. You would obviously not want to uninstall Java if an app or web app you use requires Java. An alternative option would be to simply disable Java instead, which turns it off but does not remove it from the computer.
Uninstalling Java on the Mac
Removing Java from the Mac is a three step effort involving manually deleting various java related plug-ins and files found throughout macOS / Mac OS / Mac OS X, both in the system /Library folder and in the users ~/Library folder. You should always back up your Mac before removing any item found within a system directory. Here is what you’ll want to do and look for via the Finder:
- Quit out of any active web browser or any other app which uses Java
- From the Mac Finder, pull down the “Go” menu and choose “Go To Folder” and enter the following path:
- Locate and delete “JavaAppletPlugin.plugin” from this folder – note moving this item to the trash requires an admin login
- Now go back to the ‘Go’ menu and “Go To Folder” and enter the following path:
- Locate and delete “JavaControlPanel.prefPane” from this folder, again you will need an admin login
- Again return to the “Go” menu and “Go To Folder” to the following path:
- Remove the “Java” folder
- Empty the Trash on the Mac as usual
Java will be removed completely this way.
The Finder based approach is the easier and safer way to uninstall Java from a Mac, though Mac users can also remove Java and JRE via the command line as well.
Uninstalling Java and JRE from Mac OS Command Line
You can also uninstall Java from the command line by using the rm command, this is aimed for advanced users who understand the ramifications of using rm with superuser privileges. This is not for novice users, using the command line requires precise syntax and failure to use proper syntax may result in erroneous commands or unintended data loss.
One by one, execute each of the following commands individually:
sudo rm -rf "/Library/Internet Plug-Ins/JavaAppletPlugin.plugin"
sudo rm -rf "/Library/PreferencePanes/JavaControlPanel.prefPane"
sudo rm -rf "~/Library/Application Support/Java"
This requires authenticating with sudo. Be certain you have the syntax 100% correct, if you are not sure if the syntax is correct do not execute the commands, and instead you’d likely want to use the Finder based approach of uninstalling java instead.
Note that whether you uninstall Java and JRE by command line or by the Mac Finder GUI, the result is the same, you are specifically removing the Java plugins, control panels, and application support for Java from the Mac.
You can always reinstall Java onto the Mac again at a later point if you decide to, or determine it’s necessary. Most Mac users do not need Java on their computers and thus won’t need to install it.