How do i get the current Java version available using c#?
I have been able to find a way to get the java version on my PC using C# but I need to be able to compare
Try:
ProcessStartInfo psi = new ProcessStartInfo();
psi.FileName = "javac";
psi.UseShellExecute = true;
psi.RedirectStandardError = true;
psi.Arguments = "-version";
Process p = Process.Start(psi);
string strOutput = p.StandardError.ReadToEnd();
p.WaitForExit();
Then you should parse the string of output. This output normally looks like:
javac 1.6.0_27
In case you are interested in the Runtime Environment (RE), replace javac
with java