.jar won't run when launched from C# program
<p>I'm using C# to develop some programs for Kinect. C# doesn't have anything as good as Java's Robot for simulating Keystrokes or Mouse movements, so I'm using Java for that. At the moment, I'm creating .jar files and trying to run them from the C# application (although I'm suspicious that there's a better way to do it). The way I do this is by putting this line in my C# code:</p>

<pre><code>System.Diagnostics.Process.Start("CMD.exe", java -jar C:\\Users\\Me\\RobotProgram.jar");
</code></pre>

<p>This works fine in a small, basic C# application:</p>

<pre><code>using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
           System.Diagnostics.Process.Start("CMD.exe", "/c java -jar C:\\Users\\Me\\RobotProgram.jar");
        }
    }
}
</code></pre>

<p>But when it's in a more complex program that uses the Kinect camera, it won't work. The console flashes up saying "Error occurred during initialization of VM java/lang/NoClassDefFoundError: java/lang/Object".</p>
