if you're using the RP camera, you can append a line to /etc/modules(although RP3 has a bcm2837 processor):
bcm2835-v4l2
Then the V4L2 driver will be loaded automatically at boot, and the webcam-capture lib can be used to capture image or video now as a standard java application.