Uninstalling the JDK
sudo rm -fr /Library/Internet\ Plug-Ins/JavaAppletPlugin.plugin
sudo rm -fr /Library/PreferencePanes/JavaControlPanel.prefPane
sudo rm -fr ~/Library/Application\ Support/Oracle/Java
To uninstall the JDK, you must have Administrator privileges and execute the remove command either as root or by using the sudo(8) tool.
Navigate to /Library/Java/JavaVirtualMachines
and remove the directory whose name matches the following format:Foot1
/Library/Java/JavaVirtualMachines/jdkmajor.minor.macro[_update].jdk
For example, to uninstall 8u6:
% rm -rf jdk1.8.0_06.jdk