Configuring BBj 18.20+ for Java 11 and OpenJFX

Background

The BBjHtmlView control, introduced in BBj 7, originally provided a way to display only simple HTML 3.2 content, but it has become much more capable since then. The incorporation of JavaFX 2.2 into Java 7, followed by the much more tightly-integrated JavaFX 8 into Java 8, provided a modern WebKit browser-based component to serve as the basis for a much more capable client in BBj 15, with the ability to render modern HTML5, CSS4, and JavaScript content. BBj 16 added the BBjHtmlEdit, also based on the JavaFX WebKit engine.

BBj 18.20 added a second browser-based BBjHtmlView client, backed by a Chromium browser engine and independent of JavaFX. BBj 19 added a comparable Chromium BBjHtmlEdit client. These Chromium-based clients are now included with BBj, and are configured as the default clients, presenting the same high level API as the JavaFX-based BBjHtmlView and BBjHtmlEdit clients. They are updated regularly, closely tracking the functionality of the Google Chrome browser.

With the release of Java 11, Oracle chose to break out JavaFX as a separately downloadable component. Users who wish to continue using the JavaFX-based BBjHtmlView or BBjHtmlEdit must perform the following additional configuration steps after installing BBj.

Configuration

  1. Download the current version of OpenJFX for Windows, Linux, or macOS from https://openjfx.io/.

  2. Extract that archive anywhere on your system. The initial release will be extracted to a javafx-sdk-11 directory.

  3. Edit your basis/cfg/BBj.properties file to point to that extracted javafx-sdk-11 library, and add several additional configuration flags to enable the BBjHtmlView and BBjHtmlEdit controls to work with this library. When copying the lines below, replace <jdk-install-directory> and <javafx-install-directory> with the installation directories of the JDK and JavaFX, respectively.

    Update:

    As of BBj 21, the basis.javamod.options.Default setting has been removed. All module parameters described below should be added to the relevant basis.java.args.* lines. For server installations, add the module parameters to basis.java.args.BBjServices. For client installations, add them to basis.java.args.TCProxyServer.

  4. Windows:

    basis.java.jvm.Default=<jdk-install-directory>\\bin\\server\\jvm.dll
    basis.javamod.options.Default=--module-path\=<javafx-install-directory>\\lib
    --add-modules\=java.se,javafx.base,javafx.controls,javafx.fxml,javafx.graphics,javafx.media,javafx.swing,javafx.web
    --add-exports\=javafx.base/com.sun.javafx.runtime\=ALL-UNNAMED
    --add-exports\=javafx.web/com.sun.javafx.webkit\=ALL-UNNAMED
    --add-exports\=javafx.web/com.sun.webkit\=ALL-UNNAMED
    --add-exports\=java.base/jdk.internal.loader\=ALL-UNNAMED
    --add-opens\=java.base/jdk.internal.loader\=ALL-UNNAMED
    --add-exports\=java.desktop/java.awt.dnd.peer\=javafx.swing
    --add-exports\=java.desktop/sun.awt\=javafx.swing
    --add-exports\=java.desktop/sun.awt.dnd\=javafx.swing
    --add-exports\=java.desktop/sun.awt.image\=javafx.swing
    --add-exports\=java.desktop/sun.java2d\=javafx.swing
    --add-exports\=java.desktop/sun.swing\=javafx.swing
    --add-opens\=jdk.management/com.sun.management.internal\=ALL-UNNAMED

    Linux:

    basis.java.jvm.Default=<jdk-install-directory>//bin/java
    basis.javamod.options.Default=--module-path\=<javafx-install-directory>/lib
    --add-modules\=java.se,javafx.base,javafx.controls,javafx.fxml,javafx.graphics,javafx.media,javafx.swing,javafx.web
    --add-exports\=javafx.base/com.sun.javafx.runtime\=ALL-UNNAMED
    --add-exports\=javafx.web/com.sun.javafx.webkit\=ALL-UNNAMED
    --add-exports\=javafx.web/com.sun.webkit\=ALL-UNNAMED
    --add-exports\=java.base/jdk.internal.loader\=ALL-UNNAMED
    --add-opens\=java.base/jdk.internal.loader\=ALL-UNNAMED
    --add-exports\=java.desktop/java.awt.dnd.peer\=javafx.swing
    --add-exports\=java.desktop/sun.awt\=javafx.swing
    --add-exports\=java.desktop/sun.awt.dnd\=javafx.swing
    --add-exports\=java.desktop/sun.awt.image\=javafx.swing
    --add-exports\=java.desktop/sun.java2d\=javafx.swing
    --add-exports\=java.desktop/sun.swing\=javafx.swing

    macOS:

    basis.java.jvm.Default=<jdk-install-directory>/Contents/Home/bin/java
    basis.javamod.options.Default=--module-path\=<javafx-install-directory>/lib
    --add-modules\=java.se,javafx.base,javafx.controls,javafx.fxml,javafx.graphics,javafx.media,javafx.swing,javafx.web
    --add-exports\=javafx.base/com.sun.javafx.runtime\=ALL-UNNAMED
    --add-exports\=javafx.web/com.sun.javafx.webkit\=ALL-UNNAMED
    --add-exports\=javafx.web/com.sun.webkit\=ALL-UNNAMED
    --add-exports\=java.base/jdk.internal.loader\=ALL-UNNAMED
    --add-opens\=java.base/jdk.internal.loader\=ALL-UNNAMED
    --add-exports\=java.desktop/java.awt.dnd.peer\=javafx.swing
    --add-exports\=java.desktop/sun.awt\=javafx.swing
    --add-exports\=java.desktop/sun.awt.dnd\=javafx.swing
    --add-exports\=java.desktop/sun.awt.image\=javafx.swing
    --add-exports\=java.desktop/sun.java2d\=javafx.swing
    --add-exports\=java.desktop/sun.swing\=javafx.swing

Example

On Windows, if OpenJFX 16 is installed to the Documents directory, add the following to the BBj.properties file, replacing <Username> with the appropriate username:

basis.javamod.options.Default=--module-path\=C\:\\Users\\<Username>\\Documents\\javafx-sdk-16\\lib
--add-modules\=java.se,javafx.base,javafx.controls,javafx.fxml,javafx.graphics,javafx.media,javafx.swing,javafx.web
--add-exports\=javafx.base/com.sun.javafx.runtime\=ALL-UNNAMED
--add-exports\=javafx.web/com.sun.javafx.webkit\=ALL-UNNAMED
--add-exports\=javafx.web/com.sun.webkit\=ALL-UNNAMED
--add-exports\=java.base/jdk.internal.loader\=ALL-UNNAMED
--add-opens\=java.base/jdk.internal.loader\=ALL-UNNAMED
--add-exports\=java.desktop/java.awt.dnd.peer\=javafx.swing
--add-exports\=java.desktop/sun.awt\=javafx.swing
--add-exports\=java.desktop/sun.awt.dnd\=javafx.swing
--add-exports\=java.desktop/sun.awt.image\=javafx.swing
--add-exports\=java.desktop/sun.java2d\=javafx.swing
--add-exports\=java.desktop/sun.swing\=javafx.swing
--add-opens\=jdk.management/com.sun.management.internal\=ALL-UNNAMED