[英]JDK8: "java.lang.NoClassDefFoundError: javax/xml/ws/Service"
[英]java Runtime error with module logic: java.lang.NoClassDefFoundError: javax/xml/ws/Service
由于我迁移到jdk9,因此在运行时出现以下错误:
java.lang.NoClassDefFoundError: javax/xml/ws/Service
我没有编译错误,只有运行时错误。 module-info如下:
module CXFPExGenCaller {
requires java.xml;
requires java.logging;
requires java.xml.bind;
requires java.xml.ws;
exports ......;
}
pom.xml包含以下依赖项:
<dependency>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
<version>2.2.12-b141001.1542</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-core</artifactId>
<version>2.2.11</version>
<scope>test</scope>
</dependency>
即使我尝试了不同的配置,最终结果仍然是这个烦人的错误! 有人对这里发生的事情有想法吗?
我已经理解我在做的错误,请尝试以下答案: Jdk9模块概念
我正在使用JUnit在IntelliJ IDE上测试我的类,并且我仅根据以下图像设置了编译器选项,而不是同时设置了运行时的VM选项: 我不确定这是否是最佳做法,但这可以解决我目前的问题
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.