[英]Adding VM flag to pom.xml file in JavaFX Maven project
I am trying to run my JavaFX application via Maven.我正在尝试通过 Maven 运行我的 JavaFX 应用程序。
I use Archlinux + Wayland + Java 11 (JDK + JFX).我使用 Archlinux + Wayland + Java 11 (JDK + JFX)。
I have been getting this error message:我一直收到此错误消息:
(java:26713): Gdk-CRITICAL **: 11:35:39.602: gdk_x11_display_set_window_scale: assertion 'GDK_IS_X11_DISPLAY (display)' failed
I should use -Djdk.gtk.version=2
VM flag according to this GitHub issue:根据此 GitHub 问题,我应该使用
-Djdk.gtk.version=2
VM 标志:
https://github.com/bisq-network/bisq/issues/2279#issuecomment-469010726 https://github.com/bisq-network/bisq/issues/2279#issuecomment-469010726
How can I add that VM flag to my pom.xml
file?如何将该 VM 标志添加到我的
pom.xml
文件中?
I've already tried to insert this code, but the syntax must be wrong.我已经尝试插入此代码,但语法一定是错误的。
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.0</version>
<configuration>
<release>11</release>
<compilerArgs>
<arg>-Djdk.gtk.version=2</arg>
</compilerArgs>
</configuration>
</plugin>
Thanks for any help!谢谢你的帮助!
From maven pass-compiler-arguments documentation you are passing the vm argument jdk.gtk.version=2
to the javac
compiler, while instead from your request you should pass it to your java VM.从maven pass-compiler-arguments文档中,您将 vm 参数
jdk.gtk.version=2
传递给javac
编译器,而从您的请求中,您应该将其传递给您的 Z93F725A0742331C886ZFB448。 From maven configure documentation to handle this issue you can configure Apache Maven in multiple ways, for example using MAVEN_OPTS
and add there your VM settings, you can check the link for additional ways to do it.从maven 配置文档来处理此问题,您可以配置 Apache Maven 以多种方式,例如使用
MAVEN_OPTS
并添加到您的 VM 设置的其他方式,
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.