JFoenix icon indicating copy to clipboard operation
JFoenix copied to clipboard

I encountered the same exception module javafx.graphics does not "opens javafx.scene.text" to module com.jfoenix as they did before, and then tried to solve my problem through those solutions, but it didn't solve it.

Open 1549742101 opened this issue 4 years ago • 4 comments

image

java.lang.reflect.InaccessibleObjectException: Unable to make private com.sun.javafx.scene.text.TextLayout javafx.scene.text.Text.getTextLayout() accessible: module javafx.graphics does not "opens javafx.scene.text" to module com.jfoenix at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:340) at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:280) at java.base/java.lang.reflect.Method.checkCanSetAccessible(Method.java:198) at java.base/java.lang.reflect.Method.setAccessible(Method.java:192) at com.jfoenix/com.jfoenix.utils.JFXHighlighter.(JFXHighlighter.java:68) at com.meiyunji.bigseller.print.views.MainController.lambda$startServer$10(MainController.java:334) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) at java.base/java.lang.Thread.run(Thread.java:834) this my config: -Dfile.encoding=GB18030 --module-path "D:\java\jdk-11.0.12\openjfx-11.0.2_windows-x64_bin-sdk\javafx-sdk-11.0.2\lib" --add-modules javafx.controls,javafx.fxml,javafx.base,javafx.graphics,javafx.media,javafx.web,com.jfoenix --add-opens javafx.graphics/javafx.css=ALL-UNNAMED --add-opens javafx.base/com.sun.javafx.runtime=ALL-UNNAMED --add-opens javafx.controls/com.sun.javafx.scene.control.behavior=ALL-UNNAMED --add-opens javafx.controls/com.sun.javafx.scene.control=ALL-UNNAMED --add-opens javafx.base/com.sun.javafx.binding=ALL-UNNAMED --add-opens javafx.base/com.sun.javafx.event=ALL-UNNAMED --add-opens javafx.graphics/com.sun.javafx.stage=ALL-UNNAMED --add-opens javafx.graphics/com.sun.javafx.scene=ALL-UNNAMED --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.base/com.sun.javafx.event=com.jfoenix --add-exports javafx.graphics/com.sun.javafx.stage=com.jfoenix --add-exports javafx.graphics/com.sun.javafx.scene=com.jfoenix --add-exports javafx.graphics/com.sun.javafx.scene.text=com.jfoenix --add-exports javafx.graphics/com.sun.javafx.geom=com.jfoenix --add-exports javafx.graphics/com.sun.javafx.util=com.jfoenix --add-exports javafx.graphics/com.sun.javafx.scene.traversal=com.jfoenix

1549742101 avatar Oct 18 '21 13:10 1549742101

See if adding this to JVM parameters helps (or at least changes the error to new one that can be resolved similarly). --add-opens=javafx.graphics/javafx.scene.text=com.jfoenix

louhy avatar Feb 21 '22 19:02 louhy

I added but it didn't work

wuxianggujun avatar Jul 22 '22 00:07 wuxianggujun

Solution will vary depending on the errors you're getting, my suggestion was for the exact one above. If you're having a similar problem you should probably open a new issue (unless your error is EXACTLY the same).

louhy avatar Aug 28 '22 15:08 louhy

One easy solutions is too completely disable java new module system. e.g.

org.burningwave.core.assembler.StaticComponentContainer.Modules.exportAllToAll();

ctoabidmaqbool avatar Aug 29 '22 10:08 ctoabidmaqbool