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?
System.out.println(new File(app + ".exe").exists());and see if the file exists within the location you are running from (or as specified by the path supplied with theappString)