I got a java.lang.IllegalAccessError
because of using a com.sun.*
class in Java >9. The solution to this is to add --add-exports=javafx.base/com.sun.javafx.event=org.controlsfx.controls
. I'm not sure how to add this to my build.gradle
, but I put
run {
jvmArgs = ['--add-exports=javafx.base/com.sun.javafx.event=org.controlsfx.controls']
}
into it and it didn't help. This is pretty much the issue I have. The error message is:
java.lang.IllegalAccessError: class org.controlsfx.control.textfield.AutoCompletionBinding (in unnamed module @0x2d7444bc) cannot access class com.sun.javafx.event.EventHandlerManager (in module javafx.base) because module javafx.base does not export com.sun.javafx.event to unnamed module @0x2d7444bc
at org.controlsfx.control.textfield.AutoCompletionBinding.<init>(AutoCompletionBinding.java:522) ~[controlsfx-11.0.0.jar:11.0.0]
at impl.org.controlsfx.autocompletion.AutoCompletionTextFieldBinding.<init>(AutoCompletionTextFieldBinding.java:107) ~[controlsfx-11.0.0.jar:11.0.0]
at org.controlsfx.control.textfield.TextFields.bindAutoCompletion(TextFields.java:151) ~[controlsfx-11.0.0.jar:11.0.0]
[…]
at java.lang.Thread.run(Thread.java:835) [?:?]