org.w3c.dom 包可以从多个模块访问:<unnamed>, java.xml [英] The package org.w3c.dom is accessible from more than one module: <unnamed>, java.xml

查看:52
本文介绍了org.w3c.dom 包可以从多个模块访问:<unnamed>, java.xml的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我无法将 org.w3c.dom.NodeList 包导入 Eclipse.它正在显示

I am unable to import org.w3c.dom.NodeList package to Eclipse. It is showing

可以从多个模块访问包 org.w3c.dom:, java.xml" eclipse 中的错误消息.

The package org.w3c.dom is accessible from more than one module: <unnamed>, java.xml" error message in eclipse.

请告诉我如何解决这个问题?

Please let me know how to fix this ?

Eclipse 版本:

面向企业 Java 开发人员的 Eclipse IDE.

Eclipse IDE for Enterprise Java Developers.

版本:2019-06 (4.12.0)

Version: 2019-06 (4.12.0)

版本号:20190614-1200

Build id: 20190614-1200

Java 版本:

java 版本12.0.1" 2019-04-16

java version "12.0.1" 2019-04-16

Java(TM) SE 运行时环境(构建 12.0.1+12)

Java(TM) SE Runtime Environment (build 12.0.1+12)

Java HotSpot(TM) 64 位服务器 VM(构建 12.0.1+12,混合模式,共享)

Java HotSpot(TM) 64-Bit Server VM (build 12.0.1+12, mixed mode, sharing)

推荐答案

由于一个可传递的 xml-apis 依赖关系,我遇到了类似的问题.我使用 Maven 排除解决了它:

I had a similar issue because of a transitive xml-apis dependency. I resolved it using a Maven exclusion:

<dependency>
    <groupId>org.apache.xmlgraphics</groupId>
    <artifactId>fop</artifactId>
    <version>0.95</version>
    
    <exclusions>
        <exclusion>
            <groupId>xml-apis</groupId>
            <artifactId>xml-apis</artifactId>
        </exclusion>
    </exclusions>
</dependency>

另一个只会引起麻烦的依赖项,除了删除它之外我没有其他解决方案:

Another dependency that just causes trouble and I don't have a solution other than removing it is this one:

<dependency>
    <groupId>com.oracle.database.xml</groupId>
    <artifactId>xmlparserv2</artifactId>
    <version>${oracle.version}</version>
</dependency>

使用 mvn dependency:tree 查看谁带来了传递依赖,然后从那里排除.

Use mvn dependency:tree to see who brings in the transitive dependency, and then exclude that from there.

这篇关于org.w3c.dom 包可以从多个模块访问:&lt;unnamed&gt;, java.xml的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆