Issue
I'm working now in Javafx in Maven and I'm using jfoenix dependency and it seems quite problematic. the NPE issue. I tried to research about it and I can't find a solution. I will provide the errors below..
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 unnamed module @742b8504
java.lang.NullPointerException: Cannot invoke "java.lang.reflect.Field.get(Object)" because "field" is null
Caused by: java.lang.NullPointerException: Cannot invoke "javafx.scene.Node.getLayoutBounds()" because "this.textNode" is null
I've seen a query related to this, [from this question][1]
that's it, I'm using JDK 16, JFX 17 and Netbeans IDE 12.5, Scene Builder 11 and Jfoenix 9.0.10
Solution
See this comment on a pull request for jfoenix, https://github.com/bisq-network/bisq/pull/5835:
Running the desktop app only works on JDKs 11 through 15 until sshahine/JFoenix#1205 is fixed. Right now, attempting to run on JDK 16+ will result in a Cannot invoke "javafx.scene.Node.getLayoutBounds()" because "this.textNode" is null error.
So you are experiencing a known issue.
Probably the JDK 15 will works?
Yes.
Downgrade to JDK 15.
I assume it is just a JDK issue, because that is what the comment says, and an additional downgrade to JavaFX 15 in not required.
The asker tried a downgrade of just the JDK version and notes that it works in comments:
I tried to downgrade to jdk 11 and it works and then tried to do it in jdk 15 and flawlessly works.
If you continue to experience issues such as this with jfoenix, contact the jfoenix project maintainers directly.
Answered By - jewelsea