解决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

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

相关推荐
TF男孩2 小时前
ARQ:一款低成本的消息队列,实现每秒万级吞吐
后端·python·消息队列
该用户已不存在7 小时前
Mojo vs Python vs Rust: 2025年搞AI,该学哪个?
后端·python·rust
zjjuejin8 小时前
Maven环境搭建
后端·maven
站大爷IP9 小时前
Java调用Python的5种实用方案:从简单到进阶的全场景解析
python
用户83562907805114 小时前
从手动编辑到代码生成:Python 助你高效创建 Word 文档
后端·python
c8i15 小时前
python中类的基本结构、特殊属性于MRO理解
python
liwulin050615 小时前
【ESP32-CAM】HELLO WORLD
python
Doris_202315 小时前
Python条件判断语句 if、elif 、else
前端·后端·python
Doris_202316 小时前
Python 模式匹配match case
前端·后端·python
这里有鱼汤16 小时前
Python量化实盘踩坑指南:分钟K线没处理好,小心直接亏钱!
后端·python·程序员