如何针对gtk 3库运行javaFx应用程序? [英] How to run javaFx application against gtk 3 libs?
问题描述
如何强制javaFx应用程序使用gtk3库?我知道SWT允许为此设置 SWT_GTK3 = 1
环境变量。 javaFx有没有类似的可能性/解决方法?
JavaFX使用GTK2库,不太可能在不久的将来切换。
以下是相关问题 - https://javafx-jira.kenai.com / browse / RT-35264
更新:
JavaFX错误现在在bugs.openjdk.java.net上:
- https:// bugs.openjdk.java.net/browse/JDK-8088966 (关闭为重复)
- https://bugs.openjdk.java.net/browse/JDK-8089584 (open)
在上一期中有一条评论
由于在同一个应用程序中混合使用GTK2和GTK3会导致
的问题,我们可能需要提供两个本地库,一个用于GTK2
和一个用于GTK3
,从长远来看(JDK 9发布),它可能会运行在GTK3上。更新(11.05.2016) b
$ b b $ b
新功能( 8087516:对Linux上GTK 3的条件支持)允许我们在JavaFX中使用GTK v2或3。默认值没有改变 - gtk 2将被优先使用。
-Djdk.gtk.verbose = true //输出版本检测和使用
-Djdk.gtk.version = 3 //将首选版本切换到GTK 3
更多详情可以参阅这里
How to force javaFx application use gtk3 libs? I know that SWT allows to set SWT_GTK3=1
environmental variable for that purpose. Is there any similar possibility / workaround for javaFx?
JavaFX uses GTK2 libraries and is unlikely to switch in the near future. Here is the related issue - https://javafx-jira.kenai.com/browse/RT-35264
UPDATE: the JavaFX bugs are now on bugs.openjdk.java.net:
- https://bugs.openjdk.java.net/browse/JDK-8088966 (closed as duplicate)
- https://bugs.openjdk.java.net/browse/JDK-8089584 (open)
in the last issue there is a comment
Since mixing GTK2 and GTK3 in the same application causes this problem, we might have to deliver two native libraries, one for GTK2 and one for GTK3
So, in the long run (JDK 9 release) it might be possible to run against GTK3
== UPDATE (11.05.2016)
New feature (8087516: Conditional support for GTK 3 on Linux) allows us to use either GTK v2 or 3 with JavaFX. The default has not changed - gtk 2 will be used by preference.
-Djdk.gtk.verbose=true // Output the version detected and used
-Djdk.gtk.version=3 // Toggles the preferred version to GTK 3
More details can be found here
这篇关于如何针对gtk 3库运行javaFx应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!