When Terminal forks process, current app loses focus
In my case it was the Maven Failsafe Plugin that caused the annoying window focus stealing of ForkedBooter, and setting the JAVA_TOOL_OPTIONS variable in .bashrc didn't help.

This fix applies to both Failsafe and Surefire (although in my case, Surefire wasn't stealing focus).

In your pom.xml, add a &lt;argLine&gt;-Djava.awt.headless=true&lt;/argLine&gt; line inside the &lt;configuration&gt; for the failsafe (and/or) surefire plugin.

It will look like this:

&lt;!-- this is inside your &lt;project&gt;&lt;build&gt;&lt;plugins&gt; block --&gt;
&lt;plugin&gt;
    &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
    &lt;artifactId&gt;maven-surefire-plugin&lt;/artifactId&gt;
    &lt;version&gt;${maven.surefire.plugin.version}&lt;/version&gt;
    &lt;configuration&gt;
      &lt;includes&gt;
        &lt;include&gt;**/unit/**/*Test*.java&lt;/include&gt;
      &lt;/includes&gt;
      &lt;!-- prevent the annoying ForkedBooter process from stealing window 
        focus on Mac OS --&gt;
      &lt;argLine&gt;-Djava.awt.headless=true&lt;/argLine&gt;
    &lt;/configuration&gt;
  &lt;/plugin&gt;
  &lt;plugin&gt;
    &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
    &lt;artifactId&gt;maven-failsafe-plugin&lt;/artifactId&gt;
    &lt;version&gt;${maven.failsafe.plugin.version}&lt;/version&gt;
    &lt;configuration&gt;
      &lt;!-- prevent the annoying ForkedBooter process from stealing window 
        focus on Mac OS --&gt;
      &lt;argLine&gt;-Djava.awt.headless=true&lt;/argLine&gt;
      &lt;includes&gt;
        &lt;include&gt;**/integration/**/*Test*&lt;/include&gt;
      &lt;/includes&gt;
    &lt;/configuration&gt;
    &lt;executions&gt;
      &lt;execution&gt;
        &lt;goals&gt;
          &lt;goal&gt;integration-test&lt;/goal&gt;
          &lt;goal&gt;verify&lt;/goal&gt;
        &lt;/goals&gt;
      &lt;/execution&gt;
    &lt;/executions&gt;
  &lt;/plugin&gt;