Open FelipeAumannRS opened 3 years ago
def args = [
"--add-exports=javafx.graphics/com.sun.javafx.scene=ALL-UNNAMED",
"--add-exports=javafx.controls/com.sun.javafx.scene.control.behavior=ALL-UNNAMED",
"--add-exports=javafx.controls/com.sun.javafx.scene.control=ALL-UNNAMED",
"--illegal-access=warn",
"--add-opens=javafx.controls/javafx.scene.control.skin=com.jfoenix",
"--add-exports=javafx.controls/com.sun.javafx.scene.control=com.jfoenix",
"--add-exports=javafx.base/com.sun.javafx.binding=com.jfoenix",
//the next line changes everything.
**"--add-opens=java.base/java.lang.reflect=com.jfoenix",**
"--add-exports=javafx.controls/javafx.scene.control.skin=com.jfoenix",
"--add-exports=java.base/java.lang.reflect=ALL-UNNAMED",
"--add-exports=java.base/java.lang.reflect=com.jfoenix",
"--add-exports=javafx.controls/com.Sun.javafx.scene.control.behavior=com.jfoenix",
"--add-exports=javafx.graphics/com.sun.javafx.stage=com.jfoenix",
"--add-exports=javafx.controls/com.sun.javafx.scene.control.behavior=com.jfoenix",
"--add-exports=javafx.base/com.sun.javafx.event=ALL-UNNAMED",
"--add-exports=javafx.graphics/com.sun.javafx.scene=ALL-UNNAMED",
"--add-exports=javafx.controls/com.sun.javafx.scene.control.behavior" +
"=ALL-UNNAMED",
"--add-exports=javafx.controls/com.sun.javafx.scene.control=ALL-UNNAMED",
"--add-exports=javafx.controls/com.sun.javafx.scene.control.behavior" +
"=com.jfoenix",
"--add-exports=javafx.controls/com.sun.javafx.binding=com.jfoenix",
"--illegal-access=warn",
"--add-opens=javafx.controls/javafx.scene.control.skin=com.jfoenix",
"--add-opens=java.base/java.lang.reflect=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.graphics/com.sun.javafx.stage=com.jfoenix",
"--add-exports=javafx.base/com.sun.javafx.event=com.jfoenix",
"--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.graphics/com.sun.javafx.stage=com.jfoenix",
"--add-exports=javafx.base/com.sun.javafx.event=com.jfoenix"
]
run {
jvmArgs = args
}
Please take a look at my new article that explain how to export all modules to all modules at runtime in Java 16 and later without using any JVM parameter
@FelipeAumannRS I suggest to switch to non-modular project by removing the module-info.java, and use the plugin https://github.com/beryx/badass-runtime-plugin to make the executable.
And for error module java.base does not "opens java.lang.reflect"
add this library https://www.burningwave.org, and then make this call inside your init() in your main class:
See below for optimized solution.
Hop this will help.Modules.create().exportAllToAll();
@FelipeAumannRS I suggest to switch to non-modular project by removing the module-info.java, and use the plugin https://github.com/beryx/badass-runtime-plugin to make the executable. And for error
module java.base does not "opens java.lang.reflect"
add this library https://www.burningwave.org, and then make this call inside your init() in your main class:Modules.create().exportAllToAll();
Hop this will help.
Note that in this way the Modules.exportAllToAll()
method is called twice because this method is called automatically when the StaticComponentContainer
class is initialized and since the Modules
class makes use of components that are in the StaticComponentContainer
class, when you call the Modules.create()
you have practically already called the Modules.exportAllToAll()
.
To change this behavior by allowing only the manual invocation of the Modules.exportAllToAll()
methods it is necessary to include in the base folder of your class path a file named burningwave.static.properties
which contains a property named module.export-all-to-all
whose value is false (note that it is not necessary to put in the burningwave.static.properties
file all the properties present in the previous link).
Note also that is better to call org.burningwave.core.assembler.StaticComponentContainer.Modules.exportAllToAll()
(copy this entire line) instead of creating a new Modules
component.
@Roberto-Gentili , yes , I didn't notice that.
After some debugging you need just to use the class StaticComponentContainer
in any ways, ex:
org.burningwave.core.assembler.StaticComponentContainer.JVMInfo.getVersion()
and this will automatically create the class and call Modules.exportAllToAll()
only one time.
@Roberto-Gentili , yes , I didn't notice that. After some debugging you need just to use the class
StaticComponentContainer
in any ways, ex:org.burningwave.core.assembler.StaticComponentContainer.JVMInfo.getVersion()
and this will automatically create the class and callModules.exportAllToAll()
only one time.
Exactly! and remember that you can change this behavior by allowing only manual calls to the exportAllToAll
method by following the instructions in the previous answer
Hello everyone,
Before start describing how I'm getting this error, here is some important information:
Ok, let's take a look about my issue:
First, focus on the VM argument below:
If I don't use this argument, the following error pops up when the program runs:
IMPORTANT -> This is how my view shows without using the mentioned VM argument (let's call it image 1):https://snipboard.io/QJ5Fdc.jpg
"Ok, so why don't you just use the VM argument?" Great question! Alright, let's add it to my VM arguments and run the program once again.
After doing so, this is how my view looks like right now (let's call it image 2): https://snipboard.io/fbhGxw.jpg
Great! This is exactly how my view should be (note that considering it worked as expected, I've got no errors this time).
So, with everything working, I can finally move on and run my jpackage gradle task. After doing so, things stop making sense, since my view looks like the "image 1" view, regardless the fact that my project is working properly when I run it with the "run" gradle task.
### Any thoughts on why is this happening? (My guess is that my module-info.java is the key to solve it, since every time I remove an "opens" statement, e.g.: "opens my.package.name to javafx.fxml", the program gets me almost the equal error).
Let me know whether any code samples will be needed. All assistance will be appreciated. Thanks!
related stack overflow question: https://stackoverflow.com/questions/67302959/module-java-base-does-not-opens-java-lang-reflect-to-module-com-jfoenix