Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8256362

JavaFX must warn when the javafx.* modules are loaded from the classpath

XMLWordPrintable

        JavaFX is built and distributed as a set of named modules, each in its own modular jar file. This supports running both modular and non-modular applications.

        As of JDK 9, the JavaFX runtime expects to be loaded as a set of named javafx.* modules, and no longer supports loading those modules from the classpath. If it accidentally happens to work on the classpath, then it isn't by design nor it is supported. We are unlikely to address any bugs that might result from this use case.

        As such, the JavaFX runtime should produce a warning if the classes are not loaded from the expected named module.

        This restriction should be documented, so this will need a CSR.

        The main reason for doing this is to clearly indicate to application developers that they are running in an unsupported mode. Running on the classpath will fail if an application that extends javafx.application.Application, and has led to filing bugs such as JDK-8248122 (which is not the right way to solve it in the first place). It can also lead to applications that work in some modes, but not in others, since it will break encapsulation.

              kcr Kevin Rushforth
              kcr Kevin Rushforth
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

                Created:
                Updated:
                Resolved: