How to delete the Java installed shown in the "System Preferences" dialog?
You can 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 &quot;/Library/Internet Plug-Ins/JavaAppletPlugin.plugin&quot;

sudo rm -rf &quot;/Library/PreferencePanes/JavaControlPanel.prefPane&quot;

sudo rm -rf &quot;~/Library/Application Support/Java&quot;

Observations: 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.