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:
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.