Jfoenix: Jfoenix dependency illegal reflective access with java 11

Created on 14 Dec 2020  路  4Comments  路  Source: sshahine/JFoenix

WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by com.jfoenix.adapters.ReflectionHelper (file:/C:/Users/Albon/.m2/repository/com/jfoenix/jfoenix/9.0.10/jfoenix-9.0.10.jar) to method java.lang.reflect.AccessibleObject.setAccessible0(boolean)
WARNING: Please consider reporting this to the maintainers of com.jfoenix.adapters.ReflectionHelper
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release

I get this error while trying to load an fxml parent with jfoenix components. Application still works after this problem, but i'm not sure if i should just ignore it because i'm making a bigger project. Do you know what could cause it and how to fix it?

Most helpful comment

I doubt that would happen anytime soon, cause there are so many libraries dependent on java reflection. But in any case, I'll create a ticket for JavaFX to open up some internal API.

All 4 comments

Well, it's because JFoenix is using reflection to access some private methods/fields of the original JavaFX controls. To fix this issue, some changes need to be done from JavaFX side to allow more flexibility in customizing the controls. Till that happens, not much we can do.

Does it mean that it could potentially become incompatible with a future release of JavaFX? Or do you expect that a future release will open up the API?

I doubt that would happen anytime soon, cause there are so many libraries dependent on java reflection. But in any case, I'll create a ticket for JavaFX to open up some internal API.

Having a similar problem:
java.lang.IllegalAccessException: class com.jfoenix.skins.JFXTextFieldSkin (in module com.jfoenix) cannot access a member of class javafx.scene.control.skin.TextFieldSkin (in module javafx.controls) with modifiers "private"

Already tried adding
--illegal-access=warn
--add-opens javafx.controls/javafx.scene.control.skin=com.jfoenix
--add-opens java.base/java.lang.reflect=com.jfoenix

as JRE JVM Runtimeparameter as well as Maven Options without success.
Running on AdoptOpenJDK 11.0.10.9-openj9.

What is the right way to handle this? Especially looking forward to upcomming JDK releases.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

caoyanfeng picture caoyanfeng  路  3Comments

TurekBot picture TurekBot  路  5Comments

SkaaRJik picture SkaaRJik  路  4Comments

orochies picture orochies  路  5Comments

ayushchadha23 picture ayushchadha23  路  5Comments