Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Java regression testing (with AWT involved) possible without stealing desktop focus?

I've got regression tests of a Java system that don't bring up any graphical elements but do make use of the AWT event thread. Is there any way I can set things up to run this test suite in the background on my workstation without it constantly grabbing focus from whatever else I'm working on? (I'm running this on a mac.)

like image 364
Joshua Goldberg Avatar asked Mar 10 '26 18:03

Joshua Goldberg


1 Answers

Try running java with -Djava.awt.headless=true parameter. This should work for you if you are not using any graphical elements. Hopefully, it will prevent the program from grabbing focus while it is running.

java -Djava.awt.headless=true

Here are some links with more information:

http://www.macosxhints.com/article.php?story=20071208235352641

like image 129
Eric Bronnimann Avatar answered Mar 12 '26 08:03

Eric Bronnimann



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!