# Building Projects

When you click on the Java WorkShop Build button the builder builds the current
based on the information (source files, compiler options, class paths, and so on) that you specified when you created the project. You can change the project's build information at any time by editing the project's build attributes.

Build commands can also be accessed from the Build menu.

This page describes the most typical method for building projects. You may want to consider the following options when building your programs:

- You can choose to use the the standard JavaSoftTM Java Compiler instead of the default Java WorkShop compiler -- both are included with Java WorkShop. The Java WorkShop compiler is much faster, but does not support some JDK 1.1 features. Choose Preferences. -> Builder to switch compilers.
- You can use the `jwsbuild` command to build projects from the command line and from within makefiles and scripts.
- You can use Build -> Compile File to build the file currently loaded in the main source editor window.

To build a project:

1. Use the Project Manager to choose a project.
2. Click on to start the build.

   You can also start the build using commands in the Build menu.

3. As the build proceeds, the command line passed to the compiler is displayed in the Build tab at the bottom of the window. This information consists of:
   - The compiler options being used to compile the program
   - The names of the source files being compiled

   If the build completes without encountering any errors, the message "Done building project-name" is displayed in the Build tab.

   If errors are encountered:

   - They are reported in the Build tab
   - The file containing the first error is loaded into the editor with the first error highlighted in yellow.

To stop a build before it completes, choose Build -> Stop Build.

To correct syntax errors reported during compilation:

1. In the Build tab, click on the link that contains the name of the file in which the error occurred. This automatically loads that file into the WorkShop source editor. The line containing the error is centered and highlighted.

   A message is issued in the Build tab for each error. Error messages have the following components:

   - A link that contains the name of the file and the line number on which the error occurred
   - The compiler error message
2. If necessary, check the file out from the version control system.
3. Fix the errors using the source editor, and save the file.
4. When you have fixed all of the errors, click on to restart the build.

   You can use Build -> Next Error and Build -> Previous Error to move back and forth between errors in the Build tab.

See also:

  Build Menu
  Javac Help Page
  Java Compiler Preferences Dialog Box
  jwsbuild -- Batch Builder
  Editing Source
  Debugging Projects
  What Is a Project?