-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Getting ...does not export to module
exception after changing to non-modular project
#1133
Comments
...does not export to module
exception after changing to non-modular project
I'm using a modular project but it still does not work and issues same error:
module-info.java file:
|
Did you add exports? It was working just fine for me with modular, but I had to switch to non-modular because of conflicting libraries and it wasn't as easy to solve the issue, So I just opted to change, but then my JFXDatePickers dont work all of a sudden. |
I also changed it to a non-modular form then I did add |
Glad to hear that someone also has the same issue (I'm sorry XD). If you find a workaround, update me |
@buttonmasher3 @askjgafdsdfassflsdjfljdg Could you guys share your --addexports with me? And which framework are you on? Gradle? |
Exactly same problem here. @jfoenixadmin, it looks like a bug. Possibly fix: just add the following row to your jvm args: It should look like this: def args = [ run { Heres my complete list of VM arguments: def args = [
] run { Like my answer if it helps :-) |
All that junk looked disgusting to me so and I don't like copy-pasting tons of crap without at least knowing it's required, so I was able to narrow down what I needed down to this for a non-modular project (in my case at least): run { It's not hard to check the error output and add what you need one by one once you've got the syntax as demonstrated above. I am a little surprised I didn't need to export anything at all to com.jfoenix, but I can't argue with "works on my machine". Maybe the list can vary depending on your specific case. But this works for me with Java 17.0.1 (fx-zulu VM) and Gradle 7.3.2. |
Please take a look at my article that explain how to export all modules to all modules at runtime in Java 16 and later without using any JVM parameter. |
Interesting alternative above. I probably won't go that route in my case but good to know there's other choices. |
module javaFxException {
} |
I just switched my project from modular to non modular and i'm getting this exception all of a sudden.
Exception in thread "JavaFX Application Thread" java.lang.IllegalAccessError: superclass access check failed: class com.jfoenix.controls.behavior.JFXGenericPickerBehavior (in unnamed module @0x449613ed) cannot access class com.sun.javafx.scene.control.behavior.ComboBoxBaseBehavior (in module javafx.controls) because module javafx.controls does not export com.sun.javafx.scene.control.behavior to unnamed module @0x449613ed at java.base/java.lang.ClassLoader.defineClass1(Native Method) at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1016) at java.base/java.security.SecureClassLoader.defineClass(SecureClassLoader.java:174) at java.base/jdk.internal.loader.BuiltinClassLoader.defineClass(BuiltinClassLoader.java:800) at java.base/jdk.internal.loader.BuiltinClassLoader.findClassOnClassPathOrNull(BuiltinClassLoader.java:698) at java.base/jdk.internal.loader.BuiltinClassLoader.loadClassOrNull(BuiltinClassLoader.java:621) at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:579) at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178) at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521) at com.jfoenix.skins.JFXGenericPickerSkin.<init>(JFXGenericPickerSkin.java:62) at com.jfoenix.skins.JFXDatePickerSkin.<init>(JFXDatePickerSkin.java:60) at com.jfoenix.controls.JFXDatePicker.createDefaultSkin(JFXDatePicker.java:100) at javafx.controls/javafx.scene.control.Control.doProcessCSS(Control.java:897) at javafx.controls/javafx.scene.control.Control$1.doProcessCSS(Control.java:89) at javafx.controls/com.sun.javafx.scene.control.ControlHelper.processCSSImpl(ControlHelper.java:67) at javafx.graphics/com.sun.javafx.scene.NodeHelper.processCSS(NodeHelper.java:145) at javafx.graphics/javafx.scene.Parent.doProcessCSS(Parent.java:1400) at javafx.graphics/javafx.scene.Parent$1.doProcessCSS(Parent.java:125) at javafx.graphics/com.sun.javafx.scene.ParentHelper.processCSSImpl(ParentHelper.java:98) at javafx.graphics/com.sun.javafx.scene.NodeHelper.processCSS(NodeHelper.java:145) at javafx.graphics/javafx.scene.Parent.doProcessCSS(Parent.java:1400) at javafx.graphics/javafx.scene.Parent$1.doProcessCSS(Parent.java:125) at javafx.graphics/com.sun.javafx.scene.ParentHelper.processCSSImpl(ParentHelper.java:98) at javafx.graphics/com.sun.javafx.scene.NodeHelper.processCSS(NodeHelper.java:145) at javafx.graphics/javafx.scene.Parent.doProcessCSS(Parent.java:1400) at javafx.graphics/javafx.scene.Parent$1.doProcessCSS(Parent.java:125) at javafx.graphics/com.sun.javafx.scene.ParentHelper.processCSSImpl(ParentHelper.java:98) at javafx.graphics/com.sun.javafx.scene.NodeHelper.processCSS(NodeHelper.java:145) at javafx.graphics/javafx.scene.Parent.doProcessCSS(Parent.java:1400) at javafx.graphics/javafx.scene.Parent$1.doProcessCSS(Parent.java:125) at javafx.graphics/com.sun.javafx.scene.ParentHelper.processCSSImpl(ParentHelper.java:98) at javafx.graphics/com.sun.javafx.scene.NodeHelper.processCSS(NodeHelper.java:145) at javafx.graphics/javafx.scene.Node.processCSS(Node.java:9542) at javafx.graphics/javafx.scene.Node.processCSS(Node.java:9535) at javafx.graphics/javafx.scene.Node.processCSS(Node.java:9535) at javafx.graphics/javafx.scene.Node.processCSS(Node.java:9535) at javafx.graphics/javafx.scene.Node.processCSS(Node.java:9535) at javafx.graphics/javafx.scene.Scene.doCSSPass(Scene.java:569) at javafx.graphics/javafx.scene.Scene$ScenePulseListener.pulse(Scene.java:2505) at javafx.graphics/com.sun.javafx.tk.Toolkit.lambda$runPulse$2(Toolkit.java:412) at java.base/java.security.AccessController.doPrivileged(Native Method) at javafx.graphics/com.sun.javafx.tk.Toolkit.runPulse(Toolkit.java:411) at javafx.graphics/com.sun.javafx.tk.Toolkit.firePulse(Toolkit.java:438) at javafx.graphics/com.sun.javafx.tk.quantum.QuantumToolkit.pulse(QuantumToolkit.java:563) at javafx.graphics/com.sun.javafx.tk.quantum.QuantumToolkit.pulse(QuantumToolkit.java:543) at javafx.graphics/com.sun.javafx.tk.quantum.QuantumToolkit.pulseFromQueue(QuantumToolkit.java:536) at javafx.graphics/com.sun.javafx.tk.quantum.QuantumToolkit.lambda$runToolkit$11(QuantumToolkit.java:342) at javafx.graphics/com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:96) at javafx.graphics/com.sun.glass.ui.gtk.GtkApplication._runLoop(Native Method) at javafx.graphics/com.sun.glass.ui.gtk.GtkApplication.lambda$runLoop$11(GtkApplication.java:277) at java.base/java.lang.Thread.run(Thread.java:834)
I'm using gradle and this is how I add my exports in my
buld.gradle
fileapplicationDefaultJvmArgs = ['--add-exports=javafx.controls/com.sun.javafx.scene.control.behavior=com.jfoenix', '--add-exports=javafx.graphics/com.sun.javafx.scene=com.jfoenix', '--add-opens=java.base/java.lang.reflect=com.jfoenix', '--add-opens=java.base/java.lang.reflect=ALL-UNNAMED', '--add-exports=javafx.controls/com.sun.javafx.scene.control=com.jfoenix', '--add-exports=javafx.base/com.sun.javafx.binding=com.jfoenix', '--add-exports=javafx.graphics/com.sun.javafx.stage=com.jfoenix', '--add-exports=javafx.base/com.sun.javafx.event=com.jfoenix']
Am I missing something else?
It was working just fine as a modular project
The text was updated successfully, but these errors were encountered: