Your question doesn't make it clear, but are you sure you need Java enabled in your browser. Keep in mind that Java and JavaScript are two entirely separate technologies. Java is a cross-platform application framework and JavaScript is a scripting language designed for the web. Your mention of Sun Micro also confuses me, because Java has been an Oracle product for a long time now. If you're still running a Sun release of Java, you've got serious problems.
A lot of websites (StackExchange included) make heavy use of JavaScript, but very few these days actually require a Java applet.
In order to protect yourself from problems with JavaScript, addons like NoScript and AdBlock Plus can be extremely useful. NoScript essentially disables JavaScript on all sites until you specifically allow it, which saves you from getting hit by unexpected browser exploits. AdBlock Plus is useful since it allows pattern-based content blocking, so you can block certain scripts or even entire domains.
Java, on the other hand, is a completely different scenario. Most browsers don't come with a Java plugin by default, as the plugin usually comes when you install a Java Runtime Environment (JRE) on your system. Even then, the browser plugins are optional parts of the installation. NoScript's JavaScript blocking won't affect Java applets at all; they're completely separate things. The biggest problem with Java from a security perspective is that any sandbox escape vulnerability automatically allows the applet to modify your system with the same privilege level as your browser. If you're running as an administrator, that means it can control your whole system. Unfortunately, Java has a history of vulnerabilities that allow sandbox escape, and Oracle's patching schedule isn't particularly agile - there have been cases where Java 0days being used in the wild weren't patched for months.
If you're trying to protect yourself from malicious Java applets, I'd run through this checklist:
- Disable the Java plugin on all of your browsers. If you're not using Java at all, uninstall the JRE completely.
- If you need Java on a browser, get a portable copy of Firefox or Chrome and only install the plugin on that. Then use a tool such as Sandboxie to completely isolate the process from the rest of the system.
- Keep up to date with all Java patches, as well as patches for your OS and browser.
- Make sure your firewall is properly configured and up to date. Some of the better firewalls often have signatures that catch known malware applets, which can be a nice barrier.
- Use an AV, even if it's Microsoft Security Essentials.
- If you're really paranoid, only install and use Java in a dedicated virtual machine. This is pretty much the only way to make sure you have a good chance of not getting owned by Java malware.