Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Prevent background process from showing up on Dock

Tags:

java

macos

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: enter image description here

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

like image 836
Jatin Avatar asked Apr 01 '13 11:04

Jatin


1 Answers

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
like image 183
Perception Avatar answered Oct 12 '22 18:10

Perception