mojohaus / appassembler

https://www.mojohaus.org/appassembler/
MIT License
93 stars 49 forks source link

showConsoleWindow=false causes JavaFx window to start minimized #64

Open leif81 opened 6 years ago

leif81 commented 6 years ago

A side effect of using the showConsoleWindow option set to false is that it causes JavaFx application windows to start minimized. To me this is unexpected.

The problem seems to be the /min part of the line JAVACMD=start /min javaw. When /min is removed it behaves as expected for both JavaFx and Swing (tested in Java 8u161).

Workaround

In my environmentSetupFileName script, I put set JAVACMD=start javaw.

leif81 commented 6 years ago

Btw the /min fix was discovered by @seanidzenga :+1:

leif81 commented 6 years ago

The problematic line seems to be

https://github.com/mojohaus/appassembler/blob/e098be869434c657890da834c54b466314f2c6b8/appassembler-maven-plugin/src/main/java/org/codehaus/mojo/appassembler/daemon/script/DefaultScriptGenerator.java#L207

But from the surrounding context it looks like the intent was to run the process in the background. Not sure how to proceed on this one.

dantran commented 6 years ago

It was set to run in background since swing application blocks the shell. Maybe this behavior is no longer with java8?

leif81 commented 6 years ago

Ya it must have changed. I tried the same workaround (removing /min) with a Swing app in Java 8 and it worked as expected.