Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I prevent command line java processes from stealing focus in OSX?

Tags:

java

macos

Has anyone else noticed that their command line java applications in OSX create GUI processes that steal focus(ie, groovy, maven sub processes)? I'm finding it extremely annoying; probably b/c I've been living with it for like 6-8 months since I think OSX v10.6?

How can I prevent java processes from doing this in OSX?

like image 964
dsummersl Avatar asked Jan 18 '12 14:01

dsummersl


2 Answers

Eventually I found the basic solution:

For Java applications in general you can specify that they are 'headless', by adding the option -Djava.awt.headless=true to your java application.

like image 150
dsummersl Avatar answered Oct 04 '22 16:10

dsummersl


Add to your shell configuration, e.g., .bashrc:

export MAVEN_OPTS=-Djava.awt.headless=true

like image 21
bobfoster Avatar answered Oct 04 '22 17:10

bobfoster