sudo rm -rf /Library/Java/*
sudo rm -rf /Library/PreferencePanes/Java*
sudo rm -rf /Library/Internet Plug-Ins/Java*
Click Start.
Select Settings.
Select System.
Select Apps & features.
Select the program to uninstall and then click its Uninstall button.
Respond to the prompts to complete the uninstall.
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
// Please see https://docs.oracle.com/javacomponents/msi-jre/install-guide/uninstalling-jre-java-removal-and-uninstall-tools.htm#JSMSI115