title: java getRuntime().exec() not working?
body: <p>Basically, when I type these commands in 
  the terminal by hand, the sift program works and writes a .key file, but when I try to call it from my program, nothing is written. </p>
  
  <p>Am I using the exec() method correctly? I have looked through the API and I can't seem to spot where I went wrong.</p>
  
  <pre><code>public static void main(String[] args) throws IOException, InterruptedException
  {           
          //Task 1: create .key file for the input file
          String[] arr  = new String[3];
          arr[0] =  "\"C:/Users/Wesley/Documents/cv/final project/ObjectRecognition/sift/siftWin32.exe\"";
          arr[1] = "&lt;\"C:/Users/Wesley/Documents/cv/final project/ObjectRecognition/sift/cover_actual.pgm\"";
          arr[2] = "&gt;\"C:/Users/Wesley/Documents/cv/final project/ObjectRecognition/sift/keys/cover_actual.key\"";
  
          String command = (arr[0]+" "+arr[1]+" "+arr[2]);
  
          Process p=Runtime.getRuntime().exec(command); 
          p.waitFor(); 
          BufferedReader reader=new BufferedReader(new InputStreamReader(p.getInputStream())); 
          String line=reader.readLine(); 
  
          while(line!=null) 
          { 
              System.out.println(line); 
              line=reader.readLine(); 
          } 
  }
  </code></pre>