Just about all versions of all software have security issues at some point and Java is no different, the question is whether the there is ongoing development done and updates released to resolve any issues. Java is under constant development and relied on by many applications so yes it should be used, I suspect you are referring to issues which were identified quite a while ago and well and truly resolved. There is a distinction as well between Java and Javascript. Javascript does not have the power and/or risks of full Java