0

Using:

  • Mac OS X 10.9.5
  • Spring Tool Suite 3.6.1.RELEASE
  • Using the maven-surefire-plugin to run unit tests in a forked mode.

Spring Tool Suite 3.6.1.RELEASE Using the maven-surefire-plugin to run unit tests in a forked mode.

All the solutions to this problem I found around the web were about putting -Djava.awt.headless=true in various places: Spring Preferences->Java->Installed JREs->Default VM arguments, MAVEN_OPTS, .mavenrc, Run Configurations, etc. None of them stopped the icons from populating the Mac Dock.

How to keep the Spring Tool Suite maven JVM processes from placing java icons on Dock for a mac?

--Pat

pjtallman
  • 23
  • 4
  • You should post your question and answer separately. (Yes, you are allowed to answer your own question. And yes, you can accept your own answer to your own question.) – martinez314 Oct 09 '14 at 13:35

1 Answers1

1

After trying every suggestion found here and elsewhere on the web to try to get the java VM to stop putting the Java cup icon on the Mac Dock, I've found the solution for what was causing it in my case. I am posting it hoping it will help others.

What does work, at least in my particular case, is given the following in our pom.xml to configure surefire:

<plugin>
  <groupId>org.apache.maven.plugins</groupId>
  <artifactId>maven-surefire-plugin</artifactId>
  <version>${org.apache.maven.plugins.surefire-version}</version>
  <configuration>
    <argLine>-Djava.awt.headless=true</argLine>
    <reuseForks>false</reuseForks>
    <forkCount>20</forkCount>
    <excludedGroups>com.xxx.yyyy.util.IntegrationTests</excludedGroups>
  </configuration>
</plugin>

The fix being the adding of the -Djava.awt.headless=true.

You will also want to configure MAVEN_OPTS. I did it in my .bashrc file:

export MAVEN_OPTS=-Djava.awt.headless=true

No more annoying icons pop up now and take focus from the current window.

Hope this is helpful.

--Pat

pjtallman
  • 23
  • 4