eclipse-jdt / eclipse-jdt/eclipse.jdt.core

The package XXXXXX is accessible from more than one module: <unnamed>, XXXXXX

Open
#2,865 6 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
237
Forks
195
Avg merge
1d 12h
Merged PRs (30d)
47

Description

When we are migrating Eclipse RCP projects on new target platforms using java 17, we can get this stupid error :

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

This is an example with java.xml.namespace but we can have this error also for javax.xml.bind or other libraries..

Actually it means that java.xml is provided by the JDK (java.xml), and by another 'module' which has no name. This unnamed module is basically a plugin without any module name in the eclipse target platform.

I hesitated to open this bug in the PDE, but I have the feeling, this is a JDT issue... because the information is available at this level...

By the way, I got this error when I am building with maven (which probably do not use the JDT), but also in Eclipse with the jdt compiler ...

Something that could be really handy is to change the error message **to give more information**.

Namely the jdt should provide the name of the missing module (at least its path or whatever that can be used to recognize it (computed classpath used when the module is compiled for instance))... Without this information we have to look in all the code where the java.xml.namespace is used, if this is a plugin dependency or an import package, deal with transitive dependencies, search in the current target platform which plugin is pulling this dependency which should be used as an 'import package' so as to be directly bound to the idk, etc...

What I would like to see in the error message would be :

The package javax.xml.namespace is accessible from more than one module: (from : xxx/xxx/xxx.jar, and java.xml (from jdk 17)...

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.