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

前端 未结 7 1110
野性不改
野性不改 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 19:48

    On my side, I've spent a few hours to understand my issue, really closed to this one.
    The package org.w3c.dom is accessible from more than one module: , java.xml

    I wanted to migrate a project from Java 8 to Java 11. A few library issues. Easy to fix. But on this one,

    • I've tried to create module-info.java → it was worst.
    • Find a issue on my OS (debian 10) → even if Java 11 was default JRE, $JAVA_HOME was not rightly set for maven build. And when I was thinking it was only an Eclipse issue, I finally consider that it was a global compilation problem. To fix this I had to add following line in ~/.mavenrc

      JAVA_HOME=/usr/lib/jvm/default-java

    • Deep analysis on maven dependencies shows me a third-level dependency on xom.jar which trigger the issue. Dependency was linked to Saxon HE library → an upgrade to VERSION 9.9.X has resolved this boring problem.

    Hope this will helps other people.

提交回复
热议问题