I have a Java application. For some tasks, I run another JVM instance in parallel using ProcessBuilder
. i.e. my main application starts another JVM instance using Process
and then both communicate using I/O.
But on the Dock
on Mac, it shows both the process:
I do not want that, as the other process only does the back-end work and is not required to be shown up front. Also it is a risk as he can manually force quit the another process easily.
What should be done to make sure it runs on background and doesn't show itself on dock
If your back-end processor truly does not need any screen resources then the simplest thing to do is too launch the new JVM in headless mode:
java -Djava.awt.headless=true com.bl.ProcessMain
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With