JavaFX Preview

JavaFX preview allows a rich preview of AsciiDoc content when the JCEF preview is not available.

Starting from IntelliJ 2020.2 and plugin version 0.31.x the most advanced preview mode is JCEF preview. JetBrains deprecated usage of JavaFX in plugins. Future versions of the IDE might not support the JavaFX preview at all.

Why to use the JavaFX preview

The JavaFX preview provides better HTML preview and additional features like scroll-to-view and opening links in the browser compared to the Swing preview.

It can serve as a fall-back in situations where the more advanced JCEF preview is not available.

How to enable the JavaFX preview

Starting with IDEA 2020.2, the JavaFX preview is only available after installing the plugin “JavaFX for plugins”.

Once JavaFX is available, the user can change the preview to JavaFX in the plugin’s settings via File  Settings…​  Languages & Frameworks  AsciiDoc  Preview Browser.

Limitations of the JavaFX preview

The JavaFX preview has only limited support for SVGs in AsciiDoc documents. Use the JCEF preview for better SVG support and improved rendering on high-resolution displays.

Security options

If the user changes the Safe mode in the plugin’s settings from UNSAFE to any other mode, the preview in JCEF and JavaFX mode will restrict all content to the local project and will prohibit loading of external content using a content security policy (CSP). Starting with plugin version 0.36.6, all untrusted projects will default to the SECURE mode. The IDE shows a “Safe mode, limited functionality” notification once the user opens an AsciiDoc file.

When the JavaFX preview is available

The JavaFX preview works on a 64bit JDK and needs JavaFX installed. Use the JDK provided by JetBrains for the best results, as it contains relevant bug fixes. Use JetBrains OpenJDK version 11 whenever possible, as this contains additional bug fixes.

Starting with IDEA 2020.2, the JavaFX preview is only available after installing the plugin “JavaFX for plugins”.

Selecting a different JetBrains JDK using the “Choose Runtime” plugin

This is recommended for Android Studio 4.0 that includes JetBrains OpenJDK 8 by default without JavaFX support.

See JCEF Preview for more information on Android Studio 4.2 or 2020.3+.
  • Install the plugin “Choose Runtime” as described in the JetBrains knowledge base “Selecting the JDK version the IDE will run under”.

  • Choose a runtime "jbrsdk-11_0_7-…​-x64-b956.14.tar.gz" or later and install it. The IDE will restart.

  • Go to the settings of the AsciiDoc plugin and check if the preview is set to “JavaFX WebView”.Change it to “JavaFX WebView” if this is not the case.

Starting with IDEA 2020.2, the JavaFX preview is only available after installing the plugin “JavaFX for plugins”.

Known Problems with Non-JetBrains-JDKs

  • OpenJDK provided on Linux OS sometimes don’t include JavaFX, therefore, the JavaFX preview is not available.
    Use the JetBrains JDK instead.

  • Oracle JDK JavaFX package on Windows is less stable compared to the OpenJDK provided by Jetbrains and might lead to a crashing IDE.
    Use the JetBrains JDK instead.