Exec Command doesnt seem to be executing properly in java -


I have a Java project that I want to run with some other Java program. But when I call it using the exec command, it does not execute immediately, but waits for the current program to end. If I add a statement for a wait, the program hangs because the main program waits for the process and the process is waiting for the main program. Does anyone know how I can solve it? Or why is it behaving? I need this jar file that can be executed before any other.

  RuntimeGetRime (). Exec ("Java-class \" JavaProject1 / dist / JavaProject1.jar \ ""); Println ("hello"); P.waitFor ();   

The location of the jar file is fine and it prints hello. In the thread, I want to run the main square for jar file

In addition to other things, you can use STDOUT and STDERR must be kept by reading the processes, otherwise it will be blocked. For example,

see

Comments