Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

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

How can I prevent java processes from doing this in OS X?

share|improve this question
1  
This is a very good question, but I think it depends on the implementation of your Java app. If you ask those guys in Stack Overflow they might now which Java flag to turn on background mode when launching. –  Enrico Susatyo Feb 11 '12 at 3:47
    
Yeah I asked there first, and never got any kind of response. When I do 'java -version' I see: Java(TM) SE Runtime Environment (build 1.6.0_29-b11-402-11D50b) Java HotSpot(TM) 64-Bit Server VM (build 20.4-b02-402, mixed mode... –  dsummersl Feb 11 '12 at 17:21
add comment

1 Answer

up vote 5 down vote accepted

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.

(also posted to stackoverflow).

share|improve this answer
    
Even with this flag my invisible Android simulator steal focus. –  Raphael Oliveira Apr 10 '13 at 20:53
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.