解决maven编译错误:程序包com.sun.xml.internal.ws.spi不存在

解决方法如下:

添加maven-compiler-plugin插件,并且配置compilerArguments

如:

复制代码
<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-compiler-plugin</artifactId>
    <configuration>
        <source>1.8</source>
        <target>1.8</target>
        <compilerArguments>
            <bootclasspath>${JAVA_HOME}/jre/lib/rt.jar</bootclasspath>
        </compilerArguments>
    </configuration>
</plugin>

注意:

1:这里的rt.jar需要配置正确的路径

2:如果使用的类,接口等在其他的jar里面(如tools.jar),则bootclasspath值需要配置成其他的jar

配置好之后,再编译打包,就没有问题了

相关推荐
Java后端的Ai之路6 小时前
【Python 教程15】-Python和Web
python
冬奇Lab7 小时前
一天一个开源项目(第15篇):MapToPoster - 用代码将城市地图转换为精美的海报设计
python·开源
二十雨辰9 小时前
[python]-AI大模型
开发语言·人工智能·python
Yvonne爱编码9 小时前
JAVA数据结构 DAY6-栈和队列
java·开发语言·数据结构·python
前端摸鱼匠10 小时前
YOLOv8 环境配置全攻略:Python、PyTorch 与 CUDA 的和谐共生
人工智能·pytorch·python·yolo·目标检测
WangYaolove131410 小时前
基于python的在线水果销售系统(源码+文档)
python·mysql·django·毕业设计·源码
AALoveTouch10 小时前
大麦网协议分析
javascript·python
ZH154558913111 小时前
Flutter for OpenHarmony Python学习助手实战:自动化脚本开发的实现
python·学习·flutter
xcLeigh11 小时前
Python入门:Python3 requests模块全面学习教程
开发语言·python·学习·模块·python3·requests
xcLeigh11 小时前
Python入门:Python3 statistics模块全面学习教程
开发语言·python·学习·模块·python3·statistics