Disabling Java / Enabling it only on a case by case basis
Disabling the Java plugin can be done on a browser-by-browser basis:
https://java.com/en/download/help/enable_browser.xml

As macOS 10.10.5 does NOT ship with java installed, an Oracle install must have been done, you can un-install it using their docs:
https://www.java.com/en/download/help/mac_uninstall_java.xml

sudo rm -fr /Library/Internet\ Plug-Ins/JavaAppletPlugin.plugin 
sudo rm -fr /Library/PreferencePanes/JavaControlPanel.prefPane 
sudo rm -fr ~/Library/Application\ Support/Java