0

I use these versions:

  • javafx = 11.0.2
  • java jdk = 11.0.2
  • & I want to add Jfoenix = 9.0.10

Project creation steps:

  • I'm creating a JavaFX project with Maven
  • and IntelliJ automatically adding JavaFX libraries and dependency
  • after this from File->Project Structure->Libraries I'm adding jfoenix

But I have this problem at runtime:

java.lang.reflect.InaccessibleObjectException: Unable to make boolean java.lang.reflect.AccessibleObject.setAccessible0(boolean) accessible: module java.base does not "opens java.lang.reflect" to module com.jfoenix

Library image

Library image

Error image

jewelsea
  • 141,332
  • 12
  • 351
  • 391
soheil
  • 1
  • 1
  • All your other libraries are accessed via maven, you should do the same for the jfoenix dependency rather than manually adding it as a library. Libraries accessed via maven are automatically added to your module path. Your issue is a java platform module issue, so you may also need to update your `module-info.java` or make your project non-modular. – jewelsea May 05 '22 at 22:44
  • jfoenix is [not well maintained](https://stackoverflow.com/questions/70082473/working-with-javafx-in-maven-jfoenix-9-0-10-dependency-issue/70086754#70086754). I recommend [MaterialFX instead](https://stackoverflow.com/questions/71931192/using-materialfx-in-intellij/71931282#71931282). – jewelsea May 05 '22 at 22:48
  • You are unlikely to be actually using all of those dependent libraries in your list. I recommend that you don't add dependencies on libraries you don't use. – jewelsea May 05 '22 at 22:50
  • Usually, I advise using more recent Java/JDK versions, e.g. 17+. But in the case of jfoenix, I think it may be more broken for more recent JavaFX versions, so if you stick with it, using an eariler JDK/JavaFX combo might be best. – jewelsea May 05 '22 at 22:55
  • [jfoenix github page](https://github.com/sshahine/JFoenix) has maven dependency co-ordinates for jfoenix to be added to your pom.xml. – jewelsea May 05 '22 at 23:33

0 Answers0