2013-12-15 151 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

相關問題