Here is my code and I am not sure why the following error is coming up:
Opening firefox at Sun Oct 28 21:45:27 EDT 2012
java.io.IOException: Cannot run program "firefox.exe": CreateProcess error=2, The system cannot find the file specified
public static void open(String app) {
try {
Calendar calendar = Calendar.getInstance();
Date now = calendar.getTime();
System.out.println("Opening " + app + " at " + now);
ProcessBuilder builder = new ProcessBuilder(app+".exe");
builder.start();
}
catch (IOException e) {
System.out.println(e);
}
}
Any suggestions?
You have to specify the full path to the Firefox executable.