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
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
.
I was able to successfully run every aspect of the jfoenix library thus far. I still have some testing to do in my application to make sure there are no errors hidden but at this moment the following VM options fixed the issue :
--add-exports javafx.controls/com.sun.javafx.scene.control.behavior=com.jfoenix
--add-exports javafx.controls/com.sun.javafx.scene.control=com.jfoenix
--add-exports javafx.base/com.sun.javafx.binding=com.jfoenix
--add-exports javafx.graphics/com.sun.javafx.stage=com.jfoenix
--add-exports javafx.base/com.sun.javafx.event=com.jfoenix
An alternative to all this module pain is to completely abandon the JPMS and put all libraries (also JavaFX) on the classpath and then start your application via a launcher like this:
class MyAppLauncher {public static void main(String[] args) {MyApp.main(args);}}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With