I'm starting a runnable jar from a java app ( also headless runnable jar).
Tried both Runtime.getRuntime().exec()
and ProcesBuilder
method. The process gets launched just fine, but on the Mac ( 10.6 ) it shows the name of the jar I'm starting in the main menu bar and also puts in the dock Is there a way to prevent that ? Interestingly, if you start a jar with java -jar from the command line the jar name does not appear in the menu bar or process dock.
Any ideas?
Thanks
Andy
Remove Icons via the System PreferencesOpen the Apple menu and select System Preferences. Select Dock and Menu Bar. Select an item and uncheck the box next to Show in menu bar to remove it.
On your Mac, use Dock & Menu Bar System Preferences to change the appearance of the Dock, and to select items to show in the menu bar and in Control Center. To change these preferences, choose Apple menu > System Preferences, then click Dock & Menu Bar .
⌘ + drag to move the Hidden icons around in the menu bar. Click the Arrow icon to hide menu bar items.
To enable it globally instead of adding the option to each process, set the JAVA_TOOL_OPTIONS variable like this in your .bashrc/.zshrc start up script.
export JAVA_TOOL_OPTIONS='-Djava.awt.headless=true'
Reference here:
http://docs.oracle.com/javase/7/docs/webnotes/tsg/TSG-VM/html/envvars.html
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