When I try to run Java code from cmd, it works. But when I run it from ASP.NET MVC application, I always get: Cannot find or load main. This is the code I'm using:
Process p = new Process();
p.StartInfo.FileName = "C:/Program Files/Java/jdk1.8.0_20/bin/java.exe";
p.StartInfo.UseShellExecute = false;
p.StartInfo.Arguments = "E:/Atypon/TE1/src/Assignment3.DateTest";
p.StartInfo.RedirectStandardInput = true;
p.StartInfo.CreateNoWindow = true;
p.StartInfo.RedirectStandardOutput = true;
p.StartInfo.CreateNoWindow = true;
p.StartInfo.RedirectStandardError = true;
p.Start();
string result = p.StandardError.ReadToEnd();
p.WaitForExit();
What am I doing wrong?