Organizing sources

Layout on file system

Steps for defining a corresponding project

  1. Click Open Java perspective Window > Open Perspective > Other... > Java to change to the Java perspective.

  2. Click Opens the New Java Project wizard File > New > Other... > Java Project to open the New Java Project wizard.

  3. 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".

    Build Path Preferences page

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

    Java Project Source setup

  6. To add another source folder to your project, click Create new source folder link in Details pane or button Create a new Source Folder for the Project in view bar.

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

    New Source Folder dialog

  8. Click Finish to validate and close the dialog.
  9. Your project setup now looks as follows:

    Java Project Sources final setup

  10. Click Finish
  11. You now have a Java project with two source folders: sources and tests. You can start adding classes to these folders or you can copy them using drag and drop.

    Created Java project in Workspace

Related concepts

Java projects
Java views

Related reference

New Java Project Wizard
Package Explorer View