title: Starting a Jar file using System.Diagnostics.Process
body: <p>I have a jar file which I want to run from within C#.</p>
  
  <p>Here's what I have so far:</p>
  
  <pre><code>clientProcess.StartInfo.FileName = @"java -jar C:\Users\Owner\Desktop\myJarFile.jar";
              clientProcess.StartInfo.Arguments = "[Something]";
  
              clientProcess.Start();
              clientProcess.WaitForExit();
  
              int exitCode = clientProcess.ExitCode;
  </code></pre>
  
  <p>Unfortunatly I get "System could not find specified file", which makes sense since its not a file its a command.</p>
  
  <p>I've seen code online which tells you to use:</p>
  
  <pre><code>System.Diagnostics.Process.Start("java -jar myprog.jar");
  </code></pre>
  
  <p>However I need the return codes AND I need to wait for it to exit.</p>
  
  <p>Thanks.</p>