fabio_vac
fabio_vac

Reputation: 614

Java code opens application and icon is displayed

When I use OpenIMAJ (using the ImageUtilities.readMBF code)(documentation here) but also other type of code (related to image conversion) an icon is displayed in the mac dock

enter image description here

1) What is the cause of this strange behavior?

2) Is there a way to disable the icon opening? Or maybe a different code to use to avoid it?

Thanks

Upvotes: 0

Views: 50

Answers (1)

Jon
Jon

Reputation: 841

Any app that uses Java's BufferedImage class on the mac seems to do this by default, even if it doesn't open any windows. I think it's something to do with the way AWT initialises.

Anyway, assuming you're running from the command-line, the solution is to run the JVM in headless mode by adding -Djava.awt.headless=true to the command-line right after java. You can achieve this programmatically also - more details here: http://www.oracle.com/technetwork/articles/javase/headless-136834.html

Upvotes: 1

Related Questions