Nesting resources in output directory

Layout on file system

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.

    Layout 50

  4. On the next page, Type "Product/deliverables" in Default output folder field.

    Select "Product1" source folder.

    Click Link Additional Source to Project button Link Additional Source to Project in view bar.

    Layout 51

  5. In Link Additional Source click Browse.... and choose the D:\Product\sources directory.

    Layout 52

  6. Click OK to close the dialog.

  7. Click OK in confirmation dialog to remove the project as source folder.

    Layout 53

  8. Repeat previous steps to create source folder "deliverables" linked to D:\Product\deliverables directory.

    Click Finish.

    Layout 54

  9. Edit project "Product1"properties and select Java Builder Path page.

    Expand "Product/deliverables", select Excluded and click Edit....

    Layout 55

  10. Click Add... in Exclusion patterns part of the Inclusion and Exclusion Patterns dialog.

    Layout 56

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

    Layout 57

  12. Click OK twice to close dialogs.

  13. Your project source setup now looks as follows:

    Layout 58

  14. Select Libraries tab.

    Click on Add JARs....

    Layout 59

  15. Expand "Product" hierarchy to select jar files in "libraries" directory

    Click OK.

    Layout 5A

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

    Layout 5B

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