JavaFX initialization stuck

Symptoms

The IDE is either stuck or (with newer versions of the plugin) will show a message “JavaFX initialization is stuck”.

Environment

When you’re running IntelliJ on Linux with a GTK3 based desktop (like Ubuntu 19.04) using the JetBrains Runtime based on OpenJDK 8, the following will happen:

0.28.18 and later

The AsciiDoc plugin will show a notification “JavaFX initialization is stuck”

0.28.17 and earlier

The IDE will freeze once users open an AsciiDoc document with the plugin. Actually, this will happen for any JavaFX based preview, including the IntelliJ Markdown plugin.

If something like this happens in a different environment, open a GitHub issue to have it investigated.

Cause

The JetBrains Runtime based on OpenJDK 8 (aka JBR8) doesn’t include jre64/lib/amd64/libglassgtk3.so that is needed to run JavaFX in GTK3 environments.

Upon the first initialization of JavaFX it will become stuck. Newer versions oft the plugin identify this situation and instead of hanging up the IDE will present a warning message.

Remedy

Download the Build of IntelliJ that includes the JetBrains Runtime based on OpenJDK 11 (JBR11). Once the IDE uses this version, go to the plugin settings and ensure that it uses JavaFX or JCEF for the best preview experience.

Background

This was first reported with a useful stack trace in issue #299. Thank you for @ZainlessBrombie for providing detailed information and reporting back on a pre-release that helped to fix this issue.