HEADS-UP: change to FX launcher to always call main is coming in b91
Kevin Rushforth
kevin.rushforth at oracle.com
Sat May 18 10:57:49 PDT 2013
As several developers have noticed, the new Java 8 launcher semantics
for JavaFX applications changed the behavior of standalone FX
applications such that the main() method is no longer called. This has
had some undesirable consequences for some applications and is at odds
with what IDEs and Java application developers expect.
As such, https://javafx-jira.kenai.com/browse/RT-28755 was filed to
revert the part of the behavioral change that bypassed calling main().
Starting with JDK 8-b91 the algorithm for launching FX application
classes is:
1) If a "public static void main(String[])" method exists, the Java 8 FX
launcher will call it. In this case the main method must call
Application.launch() to launch the FX application. This is consistent
with what currently happens in Java 7 / FX 2 for applications run in an
IDE or from class files.
2) If a main() method does not exist, then the Java 8 FX launcher will
call the application launch method directly.
Note that the Java 8 launcher will still start up the FX toolkit prior
to calling main so that FX classes that expect the toolkit to be running
can be constructed prior to the Application class being constructed.
Let me know if you have any questions.
-- Kevin
More information about the openjfx-dev
mailing list