JVM error: Process finished with exit code 134 (interrupted by signal 6: SIGABRT)

爷,独闯天下 提交于 2020-02-22 08:06:55

问题


I am using openjdk11 + javafx11 on intellij

Every time I try running a code that requires javafx, I get this error. After some googling around, it seems like it has to do with the display server (xorg, using archlinux kde 5). But I can't find anything that helps me fix the problem.

If anyone could provide some insight to the solution, that would be delightful.

Here's the output I get when I run it:

/usr/lib/jvm/jdk-11.0.1/bin/java -Djava.library.path=/usr/lib/jvm/javafx-sdk-11.0.1/lib --module-path /usr/lib/jvm/javafx-sdk-11.0.1/lib --add-modules=javafx.controls,javafx.fxml -javaagent:/home/rurudu/Intellij/idea-IC-182.4892.20/lib/idea_rt.jar=45449:/home/rurudu/Intellij/idea-IC-182.4892.20/bin -Dfile.encoding=UTF-8 -classpath /home/rurudu/IdeaProjects/HelloFX/out/production/HelloFX:/usr/lib/jvm/javafx-sdk-11.0.1/lib/src.zip:/usr/lib/jvm/javafx-sdk-11.0.1/lib/javafx-swt.jar:/usr/lib/jvm/javafx-sdk-11.0.1/lib/javafx.web.jar:/usr/lib/jvm/javafx-sdk-11.0.1/lib/javafx.base.jar:/usr/lib/jvm/javafx-sdk-11.0.1/lib/javafx.fxml.jar:/usr/lib/jvm/javafx-sdk-11.0.1/lib/javafx.media.jar:/usr/lib/jvm/javafx-sdk-11.0.1/lib/javafx.swing.jar:/usr/lib/jvm/javafx-sdk-11.0.1/lib/javafx.controls.jar:/usr/lib/jvm/javafx-sdk-11.0.1/lib/javafx.graphics.jar sample.Main

(java:16177): Gdk-CRITICAL **: 14:11:28.282: gdk_x11_display_set_window_scale: assertion 'GDK_IS_X11_DISPLAY (display)' failed

Process finished with exit code 134 (interrupted by signal 6: SIGABRT)


回答1:


I was able to solve this by forcing jfx to run using GTK2 by adding this arg to the run command: -Djdk.gtk.version=2

Background: I ran into the exact same error while trying to run the Hello World example for OpenJFX on Fedora running Xwayland and after a bit of searching found an issue logged against openjdk-jfx that describes the same problem. In the comments it suggests forcing jfx to run with gtk2:

We tested it locally and can reproduce a crash (at a different place than you reported), and it looks like it's related to running using GTK3. The default backend was GTK2 for FX in JDK 10 and is GTK3 in FX 11. As a workaround, you can force GTK 2 by running:

java -Djdk.gtk.version=2 ...

Also, you can pass -Djdk.gtk.verbose=true to see what is being used. I also note that we can make JDK 10 crash as well on Wayland by forcing GTK 3.



来源:https://stackoverflow.com/questions/53549899/jvm-error-process-finished-with-exit-code-134-interrupted-by-signal-6-sigabrt

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!