首页 > 解决方案 > 未找到模块 java.xml.bind

问题描述

我是javafxeclipse 的新手。我从 eclipse market 安装了 eclipse 然后 javafx 。我用场景生成器生成了一个 fxml 代码,但我无法执行它。我真的被阻止了,找不到任何解决方案

--add-modules java.xml.bind在运行配置中添加了一个参数,但没有机会

 Error occurred during initialization of boot layer
java.lang.module.FindException: Module java.xml.bind not found

标签: eclipsejavafx

解决方案


这已从 JDK 11+ 版本中删除。您必须显式地将一些外部依赖项添加到您的项目中。

        <dependency>
            <groupId>javax.xml.bind</groupId>
            <artifactId>jaxb-api</artifactId>
            <version>2.3.1</version>
        </dependency>
        <dependency>
            <groupId>org.glassfish.jaxb</groupId>
            <artifactId>jaxb-runtime</artifactId>
            <version>2.3.1</version>
            <scope>runtime</scope>
        </dependency>

并删除该--add-modules指令。


推荐阅读