Accepted answer

there are probably several ways to do this:

1) uberproject is your javaproject. right click programa -> build path -> use as source folder. right click programb -> build path -> use as source folder. both programa and programb will do incremental builds to the same directory.

2) two java projects (programa and programb). you can use uberproject as your eclipse workspace which would be easiest or you can use an outside workspace and import programa and programb as external projects.

there are probably other ways as well (maven multi-module project). your choice probably depends on whether you have cyclic dependencies between projects. it should be relatively easy to try both 1 and 2 and see what works best for you.


do you need uberproject? i have the same layout but have multiple top-level projects created with file|new project. if not, can you make it a general rather than java project?


so you can do it via having two java projects in your workspace.
then the question is how to group the two projects together under "uberproject"

one way is to have an "uberproject" workspace, and switch workspaces between uberprojects. an alternative is to define "uberproject" as a working set (window:working sets) and add prmgrama and programb as projects of that working set. select that working set, and you see only those projects.

you can have one java project, and define multiple source folders for it. that is normally do that for "main" vs "test" hierarchies within the same project.

there are ways, and ways. pick one that works for you :-)


you can have multiple source directories in a single project, but your description makes it sound like you want multiple sub-projects in a project, which eclipse doesn't allow (as far as i know).

if you really just want multiple source directories, where programa, programb, etc. contain only java files and nothing else, then you can do this relatively easy. right-click on your project in the package explorer, and select build path -> configure build path.... in the dialog that pops up, make sure java build path is selected in the left pane, click the source tab, then click the add folder... button. pick programa from the list, and repeat for programb, etc.

if you want each source folder to have its own output folder, just check the allow output folders for source folders checkbox and edit the output folders as desired.

if that is not, in fact, what you want to do, then another option might be to group your projects into a working set. a working set is not an uberproject, but it does help keep your projects organized in the package explorer.

Related Query

More Query from same tag