Configuring a Java Source Folder

Creating a separate source folder allows you to separate Java source files from other files in a project.

By default, Java source files are created in the src folder at the root of the project. You can add multiple source folders.

  1. In the Workspace Navigator, right-click the project and select Properties.

    The Project Properties dialog opens.

  2. Select the Java Build Path page.
    Note: If this page is not available in the project properties, click Cancel, then verify the project has the Java nature.
  3. Select the Source tab.
  4. Do one of the following:
    Option Action
    To create a new folder Click Create New Folder and enter a folder name.

    The Java builder creates the folder when you rebuild the project.

    To specify an existing folder in the project Click the check the box next to the folder name.

    The Java builder compiles the Java source files in the Package Tree under the source folder when you rebuild the project.

  5. Click OK.
  6. Do the following, as necessary:
    • If you added source folders that contain existing source files, check for compile or build errors in the Problems view.

      Build errors can be corrected by configuring the Java library search path.

    • If prompted to verify removal of the project root as a source folder, click OK.
    • If prompted to perform a full rebuild of the project, click OK.
Related tasks
Importing Java Source Files
Configuring the Java Library Search Path

Send your feedback on this help topic to Sybase Technical Publications: pubs@sybase.com

Your comments will be sent to the technical publications staff at Sybase, Inc. For product-related issues or technical support, contact Sybase Technical Support at 1-800-8SYBASE.