Hi i am trying to build a java program but i need run a C program with arguments and after i need get the return value..
Here is what i have done.
public static void main(String[] args) throws IOException {
ProcessBuilder pr = new ProcessBuilder("C:\\Users\\MyFolder\\Desktop\\MyExe.exe", "param1", "param2");
Process process = pr.start();
InputStream is = process.getInputStream();
InputStreamReader isr = new InputStreamReader(is);
BufferedReader br = new BufferedReader(isr);
String line;
while ((line = br.readLine()) != null) {
System.out.println(line);
}
}