On my Raspberry Pi, I can successfully capture and save images from my Logitech Pro 9000 USB webcam from LXTerminal with the following bash line:
fswebcam -d /dev/video0 /home/pi/image.jpg
I want to write a java program that runs the bash line above because it is the simplest way to capture and save an image. So far, I have:
import java.io.*;
public class GrabNSave {
public static void main(String[] args) throws IOException {
Runtime.getRuntime().exec("/bin/bash -c fswebcam -d /dev/video0 /home/pi/image.jpg");
}
}
It's not working. I get no error messages. Please help!