SystemTray in modular javaFX application
Hello,
I have a modular javafX application. (javafx version 16)
I am by no means an expert on modules, but I am having issues getting it to work. After tinkering a lot with dependencies and whatnot (for some reason many dependencies are marked as runtime in maven?)
This is the farthest I've managed to get with my fixes:
Exception in thread "JavaFX Application Thread" java.lang.IllegalAccessError: class dorkbox.javaFx.JavaFxAccess (in unnamed module @0x65585da4) cannot access class com.sun.javafx.tk.Toolkit (in module javafx.graphics) because module javafx.graphics does not export com.sun.javafx.tk to unnamed module @0x65585da4
Does this issue ring a bell by chance to you?
Will this library every have module-info ?
Thank you
Not sure if related https://stackoverflow.com/questions/58050326/module-not-exporting-exception-in-javafx-12
niedz., 18 kwi 2021, 16:52 użytkownik Vladimir Iftodi < @.***> napisał:
Hello,
I have a modular javafX application. (javafx version 16)
I am by no means an expert on modules, but I am having issues getting it to work. After tinkering a lot with dependencies and whatnot (for some reason many dependencies are marked as runtime in maven?)
This is the farthest I've managed to get with my fixes:
Exception in thread "JavaFX Application Thread" java.lang.IllegalAccessError: class dorkbox.javaFx.JavaFxAccess (in unnamed module @0x65585da4) cannot access class com.sun.javafx.tk.Toolkit (in module javafx.graphics) because module javafx.graphics does not export com.sun.javafx.tk to unnamed module @0x65585da4
Does this issue ring a bell by chance to you?
Will this library every have module-info ?
Thank you
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/dorkbox/SystemTray/issues/155, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABKEFBLCN4TXNI5XXNS4RS3TJLW4PANCNFSM43EJPQXA .
Hello,
It is not related, the issue is having internal access to a module with a private package.
After googling I managed to fix it, but why does the library need such access? I'm afraid that it makes it perhaps impossible to modularize it fully?
I managed to fix it for dev mode, but I am not sure how easy it is to fix it for deployment mode.
It seems mixing modules with automatic modules is not so easy, especially when you need internal access, apparently it can be fixed with jvm add-opens, which IMO opens a can of worms.
Thank you
You're right, it's not quite working correctly with automatic modules. Other users have reported issues on this, and I'm in the middle of creating proper JPMS builds. I'm hoping they will be ready by the end of the week,
Thanks for the report!
https://git.dorkbox.com/dorkbox/SystemTray_Test is a repo that has an example working with java modules.