Launching JavaFX apps

Scott Palmer swpalmer at
Wed Jan 8 06:30:41 PST 2014

Based on the discussion I saw in the comments for RT-34236 I discovered
that using com.javafx.main.Main is not the way JavaFX 8 is supposed to
work. There are comments that read, "...making sure their Application class
has a main that calls launcher(String[] args)."

This seems to imply that a main method is now required in the Application
class when writing apps for JavaFX 8.

Is this correct?

If so. Somebody should tell NetBeans to stop injecting this comment in the
generated application class for JavaFX projects:
 * The main() method is ignored in correctly deployed JavaFX application.
 * main() serves only as fallback in case the application can not be
 * launched through deployment artifacts, e.g., in IDEs with limited FX
 * support. NetBeans ignores main().
 * @param args the command line arguments

Are the changes to the launching of JavaFX apps docuemtned somewhere?  Is
using javafxpackager or the ant task the *only* supported way of creating
JavaFX applications?  I'm currently using my own stub that runs on Java 7
and adds the jfxrt.jar to the classpath if required and then calls the
launch method on the Applicaiton class.



More information about the openjfx-dev mailing list