The first requirement to uninstall Java on Mac OS – you should have administrator privileges.
Second – you shouldn’t be afraid to use terminal.
This method works fine for any version of Java – 8, 9, 10, 11, 12, 13 or any other version.
Uninstalling Java on the Mac
- Click on Launchpad in the dock
- Search for Terminal and open it.
- Copy and paste commands to uninstall Java completely
sudo rm -rf /Library/Internet\ Plug-Ins/JavaAppletPlugin.plugin
sudo rm -rf /Library/PreferencePanes/JavaControlPanel.prefPane
sudo rm -rf /Library/Application\ Support/Oracle/Java/
sudo rm -rf /Library/Java/JavaVirtualMachines
If you want to remove a concrete version of Java, e.g. Java 9.0.1 you need:
Check what Java versions are available:
ls /Library/Java/JavaVirtualMachines/
Remove the corresponding folder with that version:
sudo rm -fr /Library/Java/JavaVirtualMachines/jdk-9.0.1.jdk
That’s it! Java is successfully deleted.