Skip to content
Advertisement

Tag: execution

How to run async bash command in java?

I’m trying to run an async bash command from a java file and wait for it to finish before I continue the java code execution. At this moment I’ve tried using Callable like so: and I call it like so: Thanks!!! Answer An easier way is to use Java 9+ .onExit(): If you want to block anyway, use .waitFor().

Advertisement