Hello, I'm using a process to compile java source code from within my program. I am then attempting to read the output ( errors , if it compiled ok etc) . But for some reason it isn't working. It works fine when using other shell commands ( ping etc ) but no output is displayed with javac.
Process process = new Process();
process.StartInfo.UseShellExecute = false;
process.StartInfo.RedirectStandardOutput = true;
process.StartInfo.RedirectStandardError = true;
process.StartInfo.CreateNoWindow = true;
process.StartInfo.UseShellExecute = false;
process.StartInfo.FileName = "javac.exe";
process.StartInfo.Arguments = "source.java";
process.Start();
MessageBox.Show(process.StandardOutput.ReadToEnd()); // for testing
Any suggestions?
: Edit problem solved was using standardoutput instead of error =/