How to uninstall Java on a Mac?

To remove Java from a Mac, launch, then execute a bunch of rm commands.

Here's how you do it:

  • Press Command + Space on your keyboard.
  • Type Terminal.
  • Press Enter.
  • Copy and paste the first command into Terminal from the list below, then hit Enter.
  • Repeat for every command.
sudo rm -fr /Library/Internet\ Plug-Ins/JavaAppletPlugin.plugin
sudo rm -fr /Library/PreferencePanes/JavaControlPanel.prefPane
sudo rm -fr ~/Library/Application\ Support/Oracle/Java