Creating a Java project with source folders

For larger projects, create a project with source folders.
Note: When using source folders, non-Java resources are copied to the output folder by the Java builder. If you have non-Java resources (documentation, for example) that should not be copied into the output folder, you can create an ordinary folder and store the resources there. You can also use the preferences page Window > Preferences > Java > Compiler > Build Path to specify a list of resources that will not be automatically copied to the output folder.

  1. From the main workbench window, click File > New > Project. The New Project wizard opens.

  2. Select Java from the left pane and Java Project from the right pane, then click Next. The New Java Project wizard opens.

  3. In the Project name field, type a name for your new Java project.

  4. Check or clear the Use default check box to indicate whether you want to use the default location for your new project. If you clear this check box, then type a path or click Browse to select a location for the project. Click Next. The Java Settings Page opens.

  5. On the Source tab, click the Add Folder button. The Source Folder Selection dialog opens.

  6. Click the Create New Folder button to create new source folder. You can also create new source folders at any time later.

  7. Select the newly created folders in the Source Folder Selection and press OK

  8. Optionally, replace the default name in the Default output folder field to use a different name for the output folder.

  9. On the Projects tab, select the required projects to be on the build path for this project.

  10. On the Libraries tab, select JAR files and CLASS file containers to add to the build path for this new project and attach source to the JAR files.

  11. On the Order and Export tab, use the Up and Down buttons to move the selected JAR file or CLASS file container up or down in the build path order for this new project.

  12. Click Finish when you are done.
Note: When you are using CVS as your repository, it is recommended that you create a .cvsignore file inside the project. In this file, add a line with the name of the output folder ("bin" for example). Adding the output folder in the .cvsignore file ensures that the CVS versioning support ignores the output folder in versioning operations.

Related concepts

Java projects
Java builder

Related tasks

Creating Java elements
Creating a new Java project
Creating a new source folder
Creating a Java project as its own source container
Creating a new Java package
Creating a new Java class
Creating a Java scrapbook page
Working with build paths

Related reference

New Java Project wizard

Legal notices