OR, Just do not let Downloaded Java Apple'tes Run, without User Approval.... and don't approve any from unKnown Sources....
Get "NoScript" and default block everything, pick and choose what to see, and simply don't open anything you didn't ask for.
yep BT and GH unfortunately there are many other ways to get the malware to your devices and even get it to execute without your permission. on mobile devices it can be delivered via malicious text, sms, email, web and other ways on PCs via email, malicious fonts, win vulnerabilities, web, .. noscript should block it but there are other ways to get infected virtually all smartphones and even older cell phones use java so it is very difficult to protect them. on PCs running Linux, Mac OS X or win you can at least remove java completely
As with all things, I recommend redundancy. I have one device for internet and one for storage that never accesses the internet.