The package org.w3c.dom is accessible from more than one module: , java.xml

前端 未结 7 1112
野性不改
野性不改 2021-01-03 19:37

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

The package org.w3c.dom is accessible from more than one mo

7条回答
  •  青春惊慌失措
    2021-01-03 20:11

    In my case, it was caused by combining the usage of:

    • JDK 11
    • dom4j 2.1.3 library

    As pointed out by others, the root cause is that dom4j and its dependencies (e.g., pull-parser) use some packages names (javax.xml.parsers, org.w3c.dom) that have been used by the JDK.

    I had to remove dom4j to solve the problem. Just use JDK's own XML api.

提交回复
热议问题