首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >ControlsFX的VM选项

ControlsFX的VM选项
EN

Stack Overflow用户
提问于 2022-09-26 10:06:38
回答 1查看 40关注 0票数 0

当我在JDK 11和TextFields.bindAutoCompletion 11.0.0中使用ControlsFX时,我有一个异常。

代码语言:javascript
复制
java.lang.IllegalAccessError: class org.controlsfx.control.textfield.AutoCompletionBinding (in module org.controlsfx.controls) cannot access class com.sun.javafx.event.EventHandlerManager (in module javafx.base) because module javafx.base does not export com.sun.javafx.event to module org.controlsfx.controls

我在plugin maven插件中添加了选项:

代码语言:javascript
复制
<plugin>
    <groupId>org.openjfx</groupId>
    <artifactId>javafx-maven-plugin</artifactId>
    <version>0.0.8</version>
    <configuration>
        <mainClass>hu.infokristaly.jpasswordprotector.JPasswordProtector</mainClass>
        <options>
            <option>--add-exports</option>
            <option>javafx.base/com.sun.javafx.event=ALL-UNNAMED</option>
        </options>
    </configuration>
    <executions>
        <execution>
            <!-- Default configuration for running -->
            <!-- Usage: mvn clean javafx:run -->
            <id>default-cli</id>
        </execution>
        <execution>
            <!-- Configuration for manual attach debugging -->
            <!-- Usage: mvn clean javafx:run@debug -->
            <id>debug</id>
            <configuration>
                <options>
                    <option>-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=localhost:8000</option>
                </options>
            </configuration>
        </execution>
        <execution>
            <!-- Configuration for automatic IDE debugging -->
            <id>ide-debug</id>
            <configuration>
                <options>
                    <option>-agentlib:jdwp=transport=dt_socket,server=n,address=${jpda.address}</option>
                </options>
            </configuration>
        </execution>
        <execution>
            <!-- Configuration for automatic IDE profiling -->
            <id>ide-profile</id>
            <configuration>
                <options>
                    <option>${profiler.jvmargs.arg1}</option>
                    <option>${profiler.jvmargs.arg2}</option>
                    <option>${profiler.jvmargs.arg3}</option>
                    <option>${profiler.jvmargs.arg4}</option>
                    <option>${profiler.jvmargs.arg5}</option>
                </options>
            </configuration>
        </execution>
    </executions>
</plugin>

但例外情况仍然存在。我搜索了谷歌,但我找不到可行的解决方案。

我的模块-info.java如下所示:

代码语言:javascript
复制
module hu.infokristaly.jpasswordprotector {
    requires javafx.controls;
    requires javafx.fxml;
    requires javafx.base;
    requires java.desktop;
    requires org.controlsfx.controls;
    requires com.google.gson;
    opens hu.infokristaly.jpasswordprotector to javafx.fxml;
    exports hu.infokristaly.jpasswordprotector;
}

这样好吗?

EN

回答 1

Stack Overflow用户

发布于 2022-09-26 11:04:21

我找到了一个解决办法:

代码语言:javascript
复制
<configuration>
    <mainClass>hu.infokristaly.jpasswordprotector.JPasswordProtector</mainClass>
    <options>
        <option>--add-exports</option>
        í<option>javafx.base/com.sun.javafx.event=org.controlsfx.controls</option>
    </options>
</configuration>

以及NetBeans 12的调试执行:

代码语言:javascript
复制
            <execution>
                <!-- Configuration for automatic IDE debugging -->
                <id>ide-debug</id>
                <configuration>
                    <options>
                        <option>-agentlib:jdwp=transport=dt_socket,server=n,address=${jpda.address}</option>
                        <option>--add-exports</option>
                        <option>javafx.base/com.sun.javafx.event=org.controlsfx.controls</option>
                    </options>
                </configuration>
            </execution>
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/73852574

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档