javajavafxjava-11java-modulejfoenix

How to fix jfoenix modules with javafx 11


So I'm adding my requires for module-info.java and finally got my program to load but as soon as tab pane wants to load from jfoenix library this error is thrown.

Caused by: java.lang.IllegalAccessError: class com.jfoenix.skins.JFXTabPaneSkin (in module com.jfoenix) cannot access class com.sun.javafx.scene.control.behavior.TabPaneBehavior (in module javafx.controls) because module javafx.controls does not export com.sun.javafx.scene.control.behavior to module com.jfoenix

Solution

  • One way you can try fixing this is by adding the vm option for the required export:

    --add-exports javafx.controls/com.sun.javafx.scene.control.behavior=com.jfoenix
    

    The ideal solution to that would be the jfoenix library to move away from using com.sun.javafx.scene.control.behavior.TabPaneBehavior.