vscode-java icon indicating copy to clipboard operation
vscode-java copied to clipboard

Get Java package collision errors even though removed offending duplicating module

Open mentaloaf opened this issue 5 years ago • 3 comments

I keep getting errors under "problems" about the package org.w3c.dom is accessible from more than one module after moving to Java 14 from 8. After doing research, what I thought was the culprit was the indirect inclusion of the xml-apis dependency which I promptly exluded using the following in my build.gradle:

configurations {
   all*.exclude group: 'xml-apis', module: 'xml-apis'
 }

I verified this did indeed remove this dependency and everything compiles cleanly from the command line. however, even after limiting modules using

--limit-module java.base,java.desktop,java.sql,java.naming

gradle arguments, I still have a bunch of "problems" in the console related to this package collision across multiple module:

The package javax.xml.parsers is accessible from more than one module: , java.xml The package org.w3c.dom is accessible from more than one module: , java.xml What am I missing? Is this an issue with vscode or do I need to do something else? I verified the JAR which my sample app builds no longer includes any JARs which would have duplicates of this package.

I have a sample vscode project which reproduces the issue here:

https://github.com/mentaloaf/vscode-examples.git

Environment

Red-hot Language Support for Java version is 0.72.0

java version "14.0.1" 2020-04-14 Java(TM) SE Runtime Environment (build 14.0.1+7) Java HotSpot(TM) 64-Bit Server VM (build 14.0.1+7, mixed mode, sharing)

VS Code Version: 1.51.1 Commit: e5a624b788d92b8d34d1392e4c4d9789406efe8f Date: 2020-11-11T01:11:34.018Z (3 wks ago) Electron: 9.3.3 Chrome: 83.0.4103.122 Node.js: 12.14.1 V8: 8.3.110.13-electron.0 OS: Darwin x64 18.7.0

Steps To Reproduce
  1. Clone the GitHub example above.
  2. Add the top level folder to a vscode workspace.
  3. Open up the "Problems" and see the errors once the language server has processed the project.
Current Result

Package collision errors in org.w3c.dom package

Expected Result

None of these errors should exist since I removed the offending Java module in the xml-apis dependency.

mentaloaf avatar Dec 08 '20 07:12 mentaloaf

Did anyone figure out a solution for this ?

rockneverdies55 avatar May 04 '21 09:05 rockneverdies55

This is still an issue with vscode 1.62.1, Java Language Support version 1.0.0. Any status updates?

mentaloaf avatar Nov 11 '21 22:11 mentaloaf

I have the same issue, with latest VSC and extension, JDK 11.0.11 on Windows 10.

falisca avatar Dec 03 '21 12:12 falisca