为什么我的JavaFX应用程序启动如此缓慢?

时间:2022-09-11 16:06:25

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

我的JavaFX应用程序的启动速度总是比Swing应用程序慢得多。比小应用程序可接受的速度慢得多。

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.

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

1 个解决方案

#1


13  

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有一个解决这个问题的选项。这是一个新的选择。我认为在NetBeans 7.3中没有出现。

为什么我的JavaFX应用程序启动如此缓慢?

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

检查生成的jar,选项JavaFX-Feature-Proxy:没有添加到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.

#1


13  

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有一个解决这个问题的选项。这是一个新的选择。我认为在NetBeans 7.3中没有出现。

为什么我的JavaFX应用程序启动如此缓慢?

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

检查生成的jar,选项JavaFX-Feature-Proxy:没有添加到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.