While we're on the subject, it's wise to find out if your system is vulnerable with Java on it. Although Java is an excellent add-on, over the years there have been reports of it having security holes, which can be exploited by remote hackers. Patches need to be issued to solve this or that problem. As for Linux, it has a built-in advantage regarding security, because permissions are required in almost everything done on the computer. So you may be safe enough with Linux, nevertheless it's best to get more information, since we're on the subject of installing Java.
I have Java on my Windows 7 machine and PowerMac G5. I do not know where they are located. I have not programmed with Java. I don't know what I would need to program with Java. I use a Java applet every day, namely Falstad's Circuit Simulator. The applet knows where to find Java on my computer.
I scan my Win 7 computer with Microsoft Security Essentials every other week. So I think I'm somewhat safe. This doesn't mean I'm doing all the precautions which are recommended by safety experts.