Overlapping products in a common source tree

The Java source files for the company's products are all held in a single package directory like this:

Layout 2

  1. Select the menu item File > New > Project.... to open the New Project wizard.
  2. On the left pane of the first wizard page, select Java, and on the right pane, select Java Project. Click Next.
  3. On the next page, type "Product1" in the Project name field. Click Next.
  4. Select "Product1" source folder and click Edit....
  5. Click Create New Folder.... Type "src" in the Folder name field.
  6. Click Advanced. Check Link to folder in the file system. Click Browse.... and choose the "AllJavaSourceFiles" directory.

    New linked folder

  7. Click OK twice to close the two dialogs.
  8. Expand the "src" source folder. Select Exclusion filters and click Edit....
  9. Click Add.... Type "com/xyz/product2/" in the Add Exclusion Pattern dialog.
  10. Click OK twice to close the two dialogs.
  11. Type "Product1/bin" in the Default output folder field.

    Source and output page after setting output

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

    Java perspective

Related concepts

Java projects
Java views

Related tasks

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

Related reference

New Java Project Wizard
Package Explorer View

Copyright (c) 2000, 2003 IBM Corporation and others. All Rights Reserved.