# Validating code in enterprise applications

The workbench includes validators that check certain files in your enterprise application module projects for errors.

By default, the workbench validates your files automatically after any build, including automatic builds. You can also begin the validation process manually without building.

On the workbench Preferences window, you can enable or disable validators to be used on your projects. Also, you can enable or disable validators for each enterprise application module project individually on the Properties page for that project.

Each validator can apply to certain types of files, certain project natures, and certain project facets. When a validator applies to a project facet or nature, the workbench uses that validator only on projects that have that facet or nature. Likewise, most validators apply only to certain types of files, so the workbench uses those validators only on those types of files.

To validate your files, complete the following steps:

1. Click Window > Preferences and select Validation in the left pane. The Validation page of the Preferences window lists the validators available in your project and their settings.
2. Optional: Review the check box options available near the top of the window to customize your validation settings:

   Option | Description
   --- | ---
   Allow projects to override these preference settings | Select to set individual validation settings for one or more of your projects.
   Suspend all validators | Select to prevent validation at the global level.
   Save all modified resources automatically prior to validating | Select to save resources you have modified before the validation begins.
   Show a confirmation dialog when performing manual validation | Select to show an informational dialog after a manual validation request has completed.

3. In the list of validators, select the check boxes next to each validator you want to use at the global level. Each validator has a check box to specify whether it is used on manual validation and/or on build validation.
4. Tune a validator by clicking the button in the Settings column. Not all validators have additional settings.
5. Begin the validation process by one of the following methods:
   - Right-click a project and click Validate.
   - Start a build.

Any errors found by the validators are listed in the Problems view.

If you want to set individual validation settings for one or more of your projects, see Overriding global validation preferences for more information.

Related reference
Common validation errors and solutions
J2EE Validators