Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Building multi project java workspace with cross dependent modules(Java9) #1249

Closed
RedIODev opened this issue Oct 28, 2022 · 2 comments
Closed
Assignees

Comments

@RedIODev
Copy link

[provide a description of the issue]

Environment
  • Operating System: Windows 10
  • JDK version: 19
  • Visual Studio Code version: 1.72.2
  • Java extension version: 1.12.0
  • Java Debugger extension version: 0.45.0
Steps To Reproduce
  1. Open a folder in vscode
  2. Create a file structure like this: FileStructure
  3. Open the folder as a multi project workspace like this: workspace
  4. Make the module main depend on sub1 and sub2
  5. (no errors from linter) run the main
Current Result

Error: Cannot resolve the modulepaths/classpaths automatically, please specify the value in the launch.json

Expected Result

Runs the main modules Main with sub1 and sub2

Additional Informations

I already tried to set the module and classpath variables in multiple ways: as relative paths from main project, as absolute paths with ${workspaceFolder}... , and with and without $auto as part of the lists. I couldn't find good information about these 2 options and how to set them correctly.
I am mimicking a eclipse multi project solution with modules and cross requirements since I discovered A: that the VSCode extension is based on eclipse and B: neither of them support "normal" single projects with multiple modules. But the nice menu to add in workspace dependencies to the other projects from eclipse is missing in vscode,

@testforstephen
Copy link
Contributor

You should use "Open Workspace from File..." menu to open it as a multi-root workspace.

If you just open it as a folder, then VS Code Java extension will consider them as one project. There is a limitation that one project can only have at most one module-info.java.

If it's opened as a multi-root workspace, then each root will be initialized as a standalone project and be able to own a module-info.java.

@github-actions
Copy link

github-actions bot commented Dec 1, 2022

This issue has been closed automatically because it needs more information and has not had recent activity. Please reach out if you have or find the answers we need so that we can investigate further.

@github-actions github-actions bot closed this as completed Dec 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants