Creating a Java Project with Source Folders

For larger projects, create a project with source folders.

Note: When using source folders, non-Java resource are copied to the output folder by the Java builder. If you have non-Java resources (e.g., documentation) that should not be copied into the output folder, you can create an ordinary folder and store the resources there.

1.

From the main workbench window, do one of the following:

  • From the drop-down menu on the Open The New Wizard button in the workbench toolbar, select Project. Then select Java on the left, and on the right, select Java Project. Then click Next.
  • Click the Open The New Wizard button; then in the left pane, select Java, and in the right pane, select Java Project. Then click Next.
  • Select from the menu bar File > New > Project. Then select Java on the left, and on the right, select Java Project. Then click Next.

2.

The New Java Project Wizard appears.

3.

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

4.

Either check or clear the box indicating that you want to use the default location for your new project. If you clear this check box, then type or browse to select a location for the project.

Click Next when you are finished.

5.

On the Source tab, choose to use project subfolders as source containers. This enables the source folder list group below.

Click the Create New Folder button to create new source folder.

You can also create new source folders at any time later. See Creating a New Source Folder

6.

If you want to use a different name for the output folder, you can replace the default name in the Build Output Folder field.

7.

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

8.

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.

9.

On the Order 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.

10.

Click Finish when you are done.

Note: When you are using CVS as your repository then 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 (e.g., "bin"). Adding the output folder in the .cvsignore file ensures that the CVS versioning support ignores the output folder in versioning operations.