i want to execute a precompiled java class file from a MVC action.the class file is placed with in the C# project folder. But Still it throws File Not Found Exception.
`Process myProcess = new Process();
myProcess.StartInfo.UseShellExecute = false;
//File not Found Exception Appears Here
myProcess.StartInfo.FileName = @"java JDKTest2";
myProcess.StartInfo.CreateNoWindow = true;
myProcess.Start();`
You need to pack java class to a jar and call it like this:
myProcess.StartInfo.UseShellExecute = false;
//File not Found Exception Appears Here
myProcess.StartInfo.FileName = "java";
myProcess.StartInfo.Arguments = @"-jar JDKTest2.jar";
myProcess.StartInfo.CreateNoWindow = true;
myProcess.Start();
Also make sure the paths to java and JDKTest2.jar are known in this context or switch to absolute path.