Search code examples
javajavafx-2startup

Why is my JavaFX application startup so slow?


My JavaFX applications always start much slower than Swing applications. Much slower than what is acceptable for a little application.

Is this 'normal' or do I have to make changes somewhere?

EDIT: I heard about some proxy issues that may affect the startup time of JavaFX apps, but I'm not sure how to debug this.


Solution

  • Based on your comments I found that the slowness problem is caused by autoproxy configuration.

    NetBeans 7.4 has an option that solves this problem. That is a new option. I think it is not present on NetBeans 7.3.

    NetBeans 7.4

    Checking the generated jar, the option JavaFX-Feature-Proxy: None is added to the MANIFEST.MF


    * Run the same application from the command line as
      java -jar MyApp.jar
    
    * This way you can see actual exceptions and trace messages (if any).
    
    * Pass "-Djavafx.verbose=true" to enable verbose output from the embedded launcher.
    
    * If your application starts slow, then it could be due to network configuration. 
    Try disabling the autoproxy configuration by passing "-Djavafx.autoproxy.disable=true" to see if it helps.