Answer the question
In order to leave comments, you need to log in
Running a third party app?
It is necessary to launch a third-party application from a Java program WITHOUT waiting for the running application to close.
For example:
launched jar'nick — notepad opened (windows environment) and jar's work was completed
Answer the question
In order to leave comments, you need to log in
Get familiar with your program. Why is she waiting for something? Does she call Process.waitFor()
? Because otherwise the calling program does not wait for the called one to complete. Here is an example code:
import java.io.IOException;
public class Run {
public static void main(String[] args) {
try {
new ProcessBuilder("/usr/bin/kwrite").start();
} catch (IOException e) {
e.printStackTrace();
}
}
}
I need to run a program from Java and close Java application. In this case, the running program will continue to work.
I can only run the application and I can't shut down the Java application. Those. it waits for the application it launched to terminate.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question