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.

  4. In Project layout group, change selection to Create separate source and output folders and edit Configure default... to modify Source folder name from "src" to "sources".

    Layout 2

  5. Click OK to return on New Java Project wizard and then click Next.

    Layout 3

  6. Click Finish
  7. Edit project "MyProject"properties and select Java Builder Path page.

    On Source tab, click Add Folder....

    Layout 4

  8. On Source Folder Selection click Create New Folder....

    Layout 5

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

    Layout 6

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

    Layout 7

  12. Click OK

  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.

    Layout 8

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