redhat-developer / redhat-developer/vscode-java

Having multiple modules gives "duplicate entry: 'module-info.java'" errors

Open
#2,163 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug JPMS
Dominant language
TypeScript
Stars
2.3k
Forks
546
Avg merge
20h 1m
Merged PRs (30d)
11

Description

hi, I was following the quick-start of jigsaw: https://openjdk.java.net/projects/jigsaw/quick-start
And I get 26 times the same error (with only 4 modules...).

Screenshot 2021-10-13 at 08 32 18

The project was not built due to "Build path contains duplicate entry: 'module-info.java' for project 'JavaModulesMakeMeSad_149bec01'". Fix the problem, then try refreshing this project and building it since it may be inconsistent

I have 4 modules, with their required module-info.java:

Screenshot 2021-10-13 at 08 39 55

In settings.json I have the following sourcepaths:

"java.project.sourcePaths": [
        "src2/org.astro",
        "src2/com.socket",
        "src2/com.greetings",
        "src2/org.fastsocket"
    ]

The expected behavior is having no errors. For convenience I made a repository here:
https://github.com/clankill3r/JavaModulesMakeMeSad

Environment
  • Operating System: OSX
  • JDK version: adoptopenjdk 11
  • Visual Studio Code version: 1.61.0
  • Java extension version: v0.82.0

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the Jigsaw quick-start and the linked JavaModulesMakeMeSad repository, then inspect the settings.json java.project.sourcePaths entries for the four modules. Reproduce the project with the listed Java, VS Code, and extension versions; done means the project builds without duplicate module-info.java errors.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, typescript, vscode
Domain
build-system, developer-experience, tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.