I have two files to be given as an input and I am using Beyond Compare tool Java API to check whether the contents in both the files are same or not.
I want to do this without opening the Beyond Compare window. Below is the code which I am using currently.
ProcessBuilder processBuilder = new ProcessBuilder("C:\\Program Files\\Beyond Compare 4\\BCompare.exe",
"file1path", "file2path","/qc=bin", "\silent");
Process ps;
try {
ps = processBuilder.start();
OutputStream os = ps.getOutputStream();
os.close();
InputStream inputStream = ps.getInputStream();
BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(inputStream));
for (String line = bufferedReader.readLine(); line != null; line = bufferedReader.readLine()) {
}
ps.waitFor();
System.out.println("Exit value :" + ps.exitValue());
} catch (IOException e) {
e.printStackTrace();
} catch (InterruptedException e) {
e.printStackTrace();
}
}
As mentioned here enter link description here, using /silent
will not open the window. Despite using /silent
, I can still see the window pop up of Beyond Compare tool. Please suggest some work around to achieve the same