如何解决如何使用JDK 14使JAXB API对项目可见
嗨
我正在尝试使用JDK 14将使用JAXB API的一些旧代码改装到我的JavaFx项目中。我正在Windows 10上使用Netbeans 12.0。这是导致编译器错误的代码片段(import语句)。我花了几天时间,到目前为止还没有运气。任何见解都会很棒。
谢谢。
package org.openjfx.mavenfxedittableview;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlElement;
import java.util.List;
@XmlRootElement (name="Persons")
public class PersonListWrapper {
}
这是POM文件中的依赖项片段
<dependencies>
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-controls</artifactId>
<version>14</version>
</dependency>
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-fxml</artifactId>
<version>14</version>
</dependency>
<dependency>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
<version>2.3.0</version>
</dependency>
<dependency>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-impl</artifactId>
<version>2.3.0</version>
</dependency>
<dependency>
<groupId>javax.activation</groupId>
<artifactId>activation</artifactId>
<version>1.1.1</version>
</dependency>
</dependencies>
这是编译器错误:
COMPILATION ERROR :
-------------------------------------------------------------
org/openjfx/mavenfxedittableview/PersonListWrapper.java:[8,22] package javax.xml.bind.annotation is not visible
(package javax.xml.bind.annotation is declared in the unnamed module,but module org.openjfx.mavenfxedittableview does not read it)
org/openjfx/mavenfxedittableview/PersonListWrapper.java:[9,but module org.openjfx.mavenfxedittableview does not read it)
2 errors
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。