The Process.Start method has another overload that takes command arguments. Try:
string sApp = @"C:\Program Files\Java\jdk1_6_10\bin\javac";
string sArg = @"c:\myjava\Test.java";
System.Diagnostics.Process.Start(sApp, sArg);
>I was just playing around, and I tried this:
>
>
>string sCommand = @"C:\Program Files\Java\jdk1_6_10\bin\javac c:\myjava\Test.java";
>System.Diagnostics.Process.Start(sCommand);
>
>
>And I get "The system cannot find the specified file"
>
>If I leave off the "c:\myjava\Test.java", then the java compiler options are displayed, so that's not the part it can't find. I have verified that the .java file is there.
>
>I created a batch file with this in it:
>
>"C:\Program Files\Java\jdk1_6_10\bin\javac" "c:\myjava\Test.java"
>
>
>I ran it and it compiled the file fine.
>
>I'm guessing it has something to do with the space in the file paths.
>
>Anyone know what's wrong?
Semper ubi sub ubi.