Sorry, there is no guaranteed protection, but one thing you can do is remove Java. Most people don’t need it, and if you do, you can always download it again. Windows itself has been updated so much, that virus writers are finding fewer weaknesses. Now, their attentions are focussed on Java, Adobe Flash and Adobe Acrobat. The average Joe is likely to need the Adobe products (Acrobat Reader for downloaded documents and forms) and Flash for many websites, including YouTube. However, you will protect yourself better if you keep those products up to date. You should be on Adobe Reader X (or 10) and Flash Player 11 – to check which version of Flash you are on, go to http://kb2.adobe.com/cps/155/tn_15507.html
The figures in a study in September put malware infections via Adobe products at 48%, and via Java at 37% with Internet Explorer trailing at a relatively safe 10%.