2013-12-15 147 views
12

我的JavaFX应用程序总是比Swing应用程序启动慢得多。比小应用程序可接受的要慢得多。为什么我的JavaFX应用程序启动如此缓慢?

这是'正常'还是我必须在某处进行更改?

编辑:我听说过一些代理问题,可能会影响JavaFX应用程序的启动时间,但我不知道如何调试此。

+1

这是不正常的,我在我的WebView重后如何立即弹出惊讶汇编。 –

+0

你正在加载哪些资源,你能提供一个演示你的问题的例子吗? – MadProgrammer

+0

@MadProgrammer不关心资源的数量。如果我尝试运行一个简单的Hello World应用程序,启动也很慢。 – ceklock

回答

13

根据您的意见,我发现缓慢问题是由autoproxy configuration造成的。

NetBeans 7.4有一个解决此问题的选项。这是一个新的选择。我认为它不在NetBeans 7.3上。

NetBeans 7.4

检查产生的罐子,选项JavaFX-Feature-Proxy: None被添加到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. 
+3

+1非常有用! – assylias

相关问题