You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Reference other unmanaged folders as dependencies #2853
Create other project 1 a package and a class where you use class of project 0.
Suppose I have 4 independent Java projects: project0, project1, project2, and project3.
Inside each project, I have the src folder, and inside some packages and classes. Project 1, 2, and 3 use classes from project0.
In Eclipse, I can indicate in a section that the sources of project 0 are used. When I try something similar in VScode, I go to configure the classpath of project one and see that it includes its src folder. When I add the src folder of project0, I get the following error: "The source path must be contained in the project root folder."
I can solve this by creating the .jar of project 0 and adding it to the other projects, but this is very inconvenient when making quick tests.
I know there are tools like Maven or Ant to do these things, but I would like to know if there is any way to indicate in vscode that one project uses classes from another without having to include the .jar as a dependency.
changed the title [-]Add src folThe source path must be contained in the project root folder.[/-][+]Add src follder error: The source path must be contained in the project root folder.[/+]on Jan 3, 2023
changed the title [-]Add src follder error: The source path must be contained in the project root folder.[/-][+]Reference other unmanaged folders as dependencies[/+]on Jan 4, 2023
I am looking for a way to add an external bin/main (for example) to my settings.json, such that it gets put on the class path. I think this ticket is asking for the same thing.
Activity
[-]Add src folThe source path must be contained in the project root folder.[/-][+]Add src follder error: The source path must be contained in the project root folder.[/+]jdneo commentedon Jan 4, 2023
AFAIK, if you are using project without build tools (unmanaged folder), we do not support referencing another unmanaged folder as a dependency today.
[-]Add src follder error: The source path must be contained in the project root folder.[/-][+]Reference other unmanaged folders as dependencies[/+]anandbibek commentedon Feb 11, 2023
@javierjcf could we try opening the lowest common parent folder in vscode and mark the different unmanaged folders as "src" in .classpath file?
This plugin will help in setting up a local project in the parent folder.
https://marketplace.visualstudio.com/items?itemName=mellena1.eclipse-new-java-project
ryanmkurtz commentedon Nov 25, 2024
I am looking for a way to add an external
bin/main(for example) to mysettings.json, such that it gets put on the class path. I think this ticket is asking for the same thing.cicciozell commentedon Jul 31, 2025
Same here, this VSC limitation is incredibly inconvenient and makes it impossible to use in fairly large projects.
cicciozell commentedon Sep 20, 2025
Maybe this thread can help: redhat-developer/vscode-rsp-ui#295 (comment)