It's never safe to use Java, as it has got a lot of security problems. However, if you need it, install it. You can install it from the Apple website or the Oracle website, with the only difference that Apple provides Java 6 and Oracle provides Java 7.
If you are not sure you can use Java 7 for the webcam, use Java 6 > http://support.apple.com/kb/DL1572?viewlocale=en_US&locale=en_US
Also, you can disable Java in Safari when you are not using it. Open Safari, go to Safari menu (on the menu bar) > Preferences > Security, and untick "Enable Java". Keep Java updated