process - Run External Programms in Java -


I want my Java program 3 to run external programs but they should not run in parallel. Program 1 should make a file, this file is input to program 2, should be input for output program 3 for program 2. And the Java program should not end, when the external program ends: This is my code, but it does not work. Can anyone help me out!

  boolean var = true; ProcessBuilder processbilder = new processbender ("CMD", "/ c", "start", "c: \\ user \\ rosana \\ desktop \\ riaas \ wins \ riss3g64", "c: \\ user \\" Rosa \\ Desktop \\ out.cnf "," C: \\ User \\ Rosa \\ Desktop \\ pruv.txt "); Process process = process builder. Start (); While (program.available () & var) {ProcessBuilder processBuilder3 = new processbender ("CMD", "/ c", "start", "c: \\ user \ \ rosanna \\ desktop \\ \ riss \\ Winlibs \\ riss3g64 "," C: \\ user \\ Rosa \\ Desktop \\ out1.cnf "," C: \\ user \\ Rosa \\ Desktop \\ hahaaaaaaaaaaaafffa2.txt "); Process process2 = processbuilder3.start (); Var = false; }  

If program 1 has not produced output, then the file program is not present, and program 2 can not start execution ... where is my fault ... code work Does not ...

You need to wait for the process to finish Can not block the existing thread until it finishes processing until the process is finished

  process.waitFor ()  

Comments

Popular posts from this blog

winforms - C# Form - Property Change -

java - Messages from .properties file do not display UTF-8 characters -

javascript - amcharts makechart not working -