# Nesting resources in output directory

### Layout on file system

- The Java source files for a product are laid out in "sources" directory.
- Java class files are laid out in "deliverable" directory.
- Project needs to use some libraries located in "deliverables/libraries" directory:

### Steps for defining a corresponding project

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 "Product" in the Project name field. Click Next.

4. On the next page, Select "Product" source folder and click Remove.

   Type "Product/deliverables" in Default output folder field.

   Then click on Add Folder....

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

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

   Click Browse.... and choose the "sources" directory in "Product".

6. Click OK to close the dialog.

7. Click again on Add Folder....

8. In Source Folder Selection dialog, click on Create New Folder...

   Type "deliverables" in the Folder name field.

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

   Click Browse.... and choose the "deliverables" directory in "Product".

9. Click OK twice to close the two dialogs.

10. You project setup now looks as follows:

11. Expand "Product/deliverables" and select Excluded

    Click on Edit... and click on Add... in Exclusion patterns part of the Inclusion and Exclusion Patterns dialog

    Type "libraries/" in Add Exclusion Pattern dialog and click OK to validate and close the dialog

12. Click OK to close the dialog.

13. Your project source setup now looks as follows:

14. Click Finish.

15. Open project properties (using Alt-Enter or contextual menu)

    Select Java Build Path page and go to Libraries tab

    Click on Add JARs... and expand "Product" hierarchy to select jar files in "libraries" directory

16. Click OK.
17. You now have a Java project with a "sources" folder and an output folder which contains nested library resources.

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