How to fix jvm options exports javafx 11 to com.jfoenix on gradle idea?

最后都变了- 提交于 2019-12-06 21:13:30

If you are running a non modular project (you don't have module-info.java), to include the VM arguments in your run task, all you need to add to your build.gradle file is:

run {

    jvmArgs = [

        "--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.base/com.sun.javafx.binding=ALL-UNNAMED",
        "--add-exports=javafx.graphics/com.sun.javafx.stage=ALL-UNNAMED",
        "--add-exports=javafx.controls/com.sun.javafx.scene.control.behavior=ALL-UNNAMED"
    ]

}

Note that in this case, you can't use --add-exports=...=com.jfoenix.

If you run a modular project, with a module descriptor like:

module hellofx {
    
    requires javafx.controls;
    
    requires javafx.fxml;
    
    requires com.jfoenix;

    
    opens org.openjfx to javafx.fxml;
    
    exports org.openjfx;

}

now these are the VM arguments that you will have to include in your build file:

run {

    jvmArgs = [

        "--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.controls/com.sun.javafx.scene.control.behavior=com.jfoenix"
    ]

}
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!