程序包javax.xml.bind.annotation.adapters不存在

问题描述:项目可以正常运行,但代码运行时会报错或直接“Maven”->“本项目”->“lifecycle”->compile,会报javax.xml.bind.annotation.adapters
程序包javax.xml.bind.annotation.adapters不存在_第1张图片
问题解析:JDK11移除了此jar包,导入相应的jar包就可以了,或者使用jdk8

<dependency>
  <groupId>javax.xml.bindgroupId>
  <artifactId>jaxb-apiartifactId>
  <version>2.3.0version>
dependency>
<dependency>
  <groupId>com.sun.xml.bindgroupId>
  <artifactId>jaxb-coreartifactId>
  <version>2.3.0version>
dependency>
<dependency>
  <groupId>com.sun.xml.bindgroupId>
  <artifactId>jaxb-implartifactId>
  <version>2.3.0version>
dependency>

或切换jdk1.8
程序包javax.xml.bind.annotation.adapters不存在_第2张图片文章参考:https://blog.51cto.com/u_12497420/3358834

你可能感兴趣的:(java)