Read here:
http://www.tomsguide.com/us/disable-java-computer,news-18042.html link author = Sue Marquette Poremba
Qualified malware removers like our essexboy here on the forums
(having experience with what malware can do when older vulnerable versions of java are (left) on a computer)
will advise
not to install it at all in the first place, so it won't come to bite you.
When you cannot do without it because of the functionality of a particular program,
make sure you always have java fully updated and patched.
Do not use any java 7 now as it is insecure, and update to java version 8.
In a browser allow it only when needed and keep it blocked for all other instances where java is asked to run.
polonus