Uploaded image for project: 'BlueJ'
  1. BlueJ
  2. BLUEJ-1212

Linux/OpenJDK: creating Swing/AWT windows throws JavaFX exception in terminal

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Medium
    • Resolution: Done
    • Affects Version/s: 4.1.3
    • Fix Version/s: 4.2.0
    • Component/s: Execution

      Description

      When BlueJ is run with OpenJDK without OpenJFX installed as part of the JDK itself (i.e. installed separately), as is the case on Debian/Ubuntu, JavaFX isn't available in the user VM unless it is explicitly added as a library. That's fine, but BlueJ intercepts creation of Swing/AWT windows and runs a method which refers to a JavaFX class, resulting in a NoClassDefFound error:

       

      Exception in thread “AWT-EventQueue-1” java.lang.NoClassDefFoundError: javafx/scene/input/KeyCombination
          at bluej.utility.Utility.appToFront(Utility.java:563)
          at bluej.utility.Utility.bringToFront(Utility.java:542)
          at bluej.runtime.ExecServer$2.eventDispatched(ExecServer.java:264)
          at java.awt.Toolkit$SelectiveAWTEventListener.eventDispatched(Toolkit.java:2427)
          at java.awt.Toolkit$ToolkitEventMulticaster.eventDispatched(Toolkit.java:2319)
          at java.awt.Toolkit.notifyAWTEventListeners(Toolkit.java:2277)
          at java.awt.Component.dispatchEventImpl(Component.java:4785)
          at java.awt.Container.dispatchEventImpl(Container.java:2296) 
      

      (etc.).

      A workaround is to add the OpenJFX runtime jar to the user libraries, via preferences - libraries - add file, then choose /usr/share/java/openfx/jre/lib/ext/jfxrt.jar. This file must be present since BlueJ requires it to run. It may be necessary to re-start BlueJ before the change takes effect.

        Attachments

          Activity

            People

            • Assignee:
              davmac Davin McCall
              Reporter:
              davmac Davin McCall
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: