title: Tomcat fails to execute external java program
body: <p>I am a total newbie in JSPs/Tomcat and to a large extent in Java as well. Here's what I have to do -- when a user clicks a button/visits a URL, I want to launch a Java program (which takes some command line arguments).</p>
  
  <p>I can very easily do </p>
  
  <pre><code>Runtime.exec("C:\\Python27\\python.exe test.py") 
  </code></pre>
  
  <p>OR </p>
  
  <pre><code>Runtime.exec("java -cp %CLASSPATH%;C:\\devprojects HelloWorld"
  </code></pre>
  
  <p>and this works fine. Where HelloWorld.class just prints "HelloWorld".</p>
  
  <p>However, when I attempt a java program which takes command line arguments, the GET request just hangs doing nothing. I don't know what logs to look for or what could be wrong here. After having spent TWO days on trying various things, I am just about to give up now.</p>
  
  <pre><code>Runtime.exec("java -cp %CLASSPATH%;C:\\devprojects Run --username Blah --password Foo");
  </code></pre>
  
  <p>What user does Tomcat end up running this java program as? Can I make it to be Administrator? This is on Windows 2008, does UAC interfere with things?</p>
  
  <p>I cannot modify the Run.class here, I HAVE to run it as is and with command line parameters.</p>
  
  <p>Please advise.</p>