Building Projects
Use the WorkShop program builder to build Java programs
easily and conveniently.
You can use the WorkShop builder to build either a
project or a single file:
- Project--If you build a Project, the information used
to build it (source files, compiler options, class paths,
etc.) is taken from the project definition. For
information about creating projects, see What Is a Project?
- File--If you build a single file, the builder determines
how to build the file using the following rules:
- The builder uses the compiler options specified in the
current project (there is always a current project). You
can determine what those options are by clicking on the
Edit Project control in the main tool bar and then bringing the Build folder to the front.
- The builder uses the classpath defined in the Options=>Paths
dialog box.
- The compiled class file is placed in the same directory
as the source file.
To build a program:
- Decide whether you are building a
project, or a single file.
- Specify the name of the project or file in one of two ways:
- Type the name of the project or file in the text field
- Activate a chooser by clicking on the ellipsis (...) button to the right of the text field.
- If you're building a project, the chooser
presents you with a choice of all the projects in the current
portfolio.
- If you're building a file, a file system chooser is presented.
Note that if you type a portion of the file's path name in the
text field before you click on the chooser button, the chooser
will open at the directory you've entered.
- Start the build by clicking on the build button in the
local tool bar.
- As the build proceeds, the command line passed to the
javac
compiler is displayed in the build
output display. This information consists of:
- The compiler options being used
to compile the program
- The path names of the directories that contain the
classes used in the compilation
- The names of the source files being compiled
If the build completes without encountering any errors, the
message "Build Succeeded" is reported just above the
build output display.
If there are errors, they are reported in the output display.
To stop a build before it
completes, click on the Stop build control in the tool bar.
To correct syntax errors reported during compilation:
- Click on the name of the file in the compiler error
message. This automatically loads the file that contains
the error into the WorkShop source editor. The line
containing the error is centered and highlighted.
A message is issued in the build output display 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
- The text of the line containing the error
- If necessary, check the file out from the version control
system.
- Fix the errors using the source editor, and save the file.
- When you have fixed all of the errors, click on the Build
control in the local tool bar to restart the build.
See also:
- Editing Source
- Debugging Projects
- What Is a Project?