# Overlapping products in a common source tree

### Layout on file system

- The Java source files for products are all held in a single main directory.
- Products are separated into four siblings packages "product1", "product2", "product3" and "product4".

### Steps for defining corresponding "Product1" and "Product2" projects

1. Open a Java perspective, select the menu item File > New > Project.... to open the New Project wizard.
2. Select Java project in the list of wizards and click Next.
3. On the next page, type "Product1" in the Project name field. Click Next.

4. On the next page, Select "Product1" source folder and click Add Folder....

5. In New Source Folder dialog, type "src" in the Folder name field.

   Click Advanced. Check Link to folder in the file system.

   Click Browse.... and choose the "AllJavaSourceFiles" directory.

6. Click OK to close the dialog.

7. Click Yes in confirmation dialog to have "Product1/bin" as default output folder.

8. Expand the "src" source folder. Select Included and click Edit....

9. In Inclusion patterns section of Inclusion and Exclusion Patterns dialog, click Add....

   Type "com/xyz/product1/" in the Add Inclusion Pattern dialog.

   Click OK to validate and close the dialog.

10. The Inclusion and Exclusion Patterns dialog now looks as follows:

    Click OK to validate and close the dialog.

11. Your project source setup now looks as follows:

    Click Finish.

12. Repeat these steps for "Product2", including "com/xyz/product2/" instead.
13. You now have two Java projects which respectively contain the sources of "product1", "product2".

Java projects
Java views

Working with build paths
Creating a new Java project
Creating a Java project with source folders
Creating a new source folder
Using the Package Explorer

New Java Project Wizard
Package Explorer View