Organizing sources

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

    Source and output folders page

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

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

    Java Project Name Setting

  5. Click OK to close the dialog.
  6. Click Yes in confirmation dialog to have "MyProject/bin" as your default output folder.

    Default output folder confirmation

  7. Click again on Add Folder....

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

  9. In New Folder dialog, type "tests" in the Folder name field.

  10. Click OK twice to close the two dialogs.
  11. Your project setup now looks as follows:

    Resulting Java Project Wizard

  12. Click Finish
  13. You now have a Java project with a "sources" and a "tests" folders. You can start adding classes to these folders or you can copy them using drag and drop.

    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

Legal notices