0

I have a maven multi-project build, just upgraded from java-8 to java-11 and got it working all fine, when building from maven command-line with jdk-11.

However, in Eclipse, I get tons of these errors, like:

  The package javax.xml.namespace is accessible from more than one module: <unnamed>, java.xml

I get same error-complaint on several javax.xml.*, org.xml.*, and org.w3c.* packages.

Yes (before you flag this post as "duplicate"), there are other posts on SO on this issue, with some suggested (all non-trivial) solutions.

But, what I still don't understand, are these...

  • How can this error pop-up only in Eclipse, when it builds OK with JDK11 from command-line?

  • Is there a bug in Eclipse-compiler?

  • Is there a bug in OpenJDK-11 compiler?

They cannot both be correct, when one says "OK", and the other throws out everything as "ERROR", can they?

What does the Java-11 spec actually say?

EDIT:

Eclipse version is 2020-12.
JDK is OpenJDK 11.0.9.1

Eclipse flags these errors whenever you try use those packages, for example:

import javax.xml.namespace.QName;
Rop
  • 3,359
  • 3
  • 38
  • 59
  • do mention the Eclipse version, and comparing the equivalent command lines of what works and what doesn't(from eclipse) might help. – Naman Jan 27 '21 at 12:27
  • 1
    It's a confirmed bug of `javac`: see first item of the _EDITs_ section in https://stackoverflow.com/a/53824670/6505250 – howlger Jan 27 '21 at 13:15
  • 1
    You could find everything in Stephan Herrmann's answer to the duplicate: a detailed explanation, links to the spec that is violated here, and a link to the bug that has not yet been fixed. – howlger Jan 27 '21 at 13:30
  • 1
    Thanks Howlger! --- Perfect answer. I read several articles on this issue, but that one did not show up high for me :( – Rop Jan 27 '21 at 14:22
  • Just realized, it's gonna be "fun", when they finally fix this bug in javac, and the whole swarm of intellij users also get hit by this sh*t-storm ;) --- it's now several days of work for me, to fix a non-trivial SOAP & legacy + spring-boot project --- I started with 7000+ errors in eclipse.... oh well.... :/ – Rop Jan 27 '21 at 15:29

0 Answers0