Product1
, Product2
, Product3
and Product4
.Open a Java perspective, select the menu item File > New > Project.... to open the New Project wizard.
Select Java project in the list of wizards and click Next.
On the next page, type "Product1" in the Project name field. Click Next.
On the next page, Select "Product1" source folder.
Click Link Additional Source to Project button in view bar.
In Link Additional Source click Browse.... and choose the D:\AllJavaSourceFiles
directory.
Type "src" in Folder name.
Click OK to close the dialog.
Click OK in confirmation dialog to have "Product1/bin" as default output folder.
Expand the "src" source folder. Select all packages you want to exclude and exclude them using popup-menu.
Your project source setup now looks as follows:
Click Finish.
Copy "Product1" project and paste it as "Product2".
Edit "Product2" project properties and go on Java Build Path page.
Select Excluded and click Edit....
In Inclusion and Exclusion Patterns, select "com/xyz/product2" and click Edit....
Change "com/xyz/product2" to "com/xyz/product1" instead.
Click OK three times to valid and close all dialogs.
You now have two Java projects which respectively contain the sources of "product1", "product2".
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