1

On some imports I get the following exception:

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

Example:

import org.w3c.dom.Document;

I'm using Eclipse, OpenJDK 11. By using Ctrl+Shift+T to find out all places

org.w3c.dom.Document is available in the modulepath/classpath of my project only gives me JDK library (JDK 11) in result list.

I don't find any other jar/libraries present in classpath of the project listed.

So why am I getting above error if org.w3c.dom package is only referenced from JDK runtime (modulepath) only?

Mark Rotteveel
  • 100,966
  • 191
  • 140
  • 197
Nirmal581
  • 43
  • 1
  • 5
  • 1
    Does this answer your question? [The package org.w3c.dom is accessible from more than one module: , java.xml](https://stackoverflow.com/questions/57286825/the-package-org-w3c-dom-is-accessible-from-more-than-one-module-unnamed-java) – Oozeerally Aug 13 '21 at 11:49
  • Even a JAR on the classpath containing the package `org.w3c.dom` is invalid Java since Java 9 independent which classes it contains. – howlger Aug 13 '21 at 12:53

0 Answers0