Process.waitFor()
? Because otherwise the calling program does not wait for completion of the called. Here is the code for example: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();
}
}
}
Find more questions by tags JavaJava Native Interface
try {
new ProcessBuilder("notepad").start();
} catch (IOException e) {
e.printStackTrace();
}
}
The notebook opened, the program hangs while running do not close Notepad — remains an open question.
How to open Notepad without closing it to complete Java application - Kaycee.Gulgowski21 commented on October 3rd 19 at 04:45
nohup
on windows. Canstart /p notepad
instead ofnotepad
will help? - beatrice.Morissett commented on October 3rd 19 at 04:48- Kaycee.Gulgowski21 commented on October 3rd 19 at 04:51