13

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.

Wouter
  • 1,829
  • 3
  • 28
  • 34
ceklock
  • 6,143
  • 10
  • 56
  • 78
  • 1
    This is not normal, I am surprised at how instantly my heavy WebView pops out after compilation. – Andrey Chaschev Dec 15 '13 at 20:28
  • What resources are you loading, can you provide an example demonstrating your problem? – MadProgrammer Dec 15 '13 at 20:34
  • @MadProgrammer does not matter the amount of resources. If I try to run a simple Hello World app the startup is slow too. – ceklock Dec 15 '13 at 20:49
  • 6
    Have you tried `-Djavafx.autoproxy.disable=true` (see section 13.3.1 of [Deploying JavaFX Applications](http://docs.oracle.com/javafx/2/deployment/troubleshooting.htm)) – MadProgrammer Dec 15 '13 at 20:57
  • Yeah, testing with -Djavafx.autoproxy.disable=true the app starts much faster. Do I have to create a .bat file to pass that parameter? I dont want a bat file. – ceklock Dec 15 '13 at 22:47
  • 2
    You can put it into the MANIFEST.MF - if you use the packager then there's an option to add the correct header – tomsontom Dec 16 '13 at 08:37

1 Answers1

14

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.
ceklock
  • 6,143
  • 10
  • 56
  • 78