Borland JBuilder 3
JBuilder 3 is a good tool for compiling, running, and debugging the
programs in Computing
Concepts with Java 2 Essentials.
Note: JBuilder 1 cannot compile Java 2 programs and therefore
cannot be used with the book. JBuilder 2 can be configured to compile Java
2 programs if you also install the JDK, but it cannot debug them. I do not
recommend that configuration for Java 2 programming. If you are using
JBuilder 1 or 2, I suggest that you upgrade to JBuilder 3.
Compiling a program
To compile a program, follow these steps:
- Select File | New... from the menu. You get a dialog box like
Double-click on the Project icon.
Tip: To bypass this dialog, simply select File | New
- You get the project wizard dialog:
- Use the Browse button to pick a directory for your work, such
as yourname\homework. Come up with a name for the
project (such as Hello or Homework1).
Tip: It is best to use a separate directory for each project.
- You can leave the other entries with their default values--they
aren't important. Click on Finish. You get a screen that looks
Note: If you already have an HTML file with the same name as
your project (such as a file with an APPLET tag), you will be
asked whether that file should be replaced. In that case, answer No.
- Click on the folder icon with the green +.
You get a file dialog. Type in the name of your Java file (such as Hello.java).
If the file doesn't yet exist, then confirm that you want to create a
- Type your program into the Source window. Save your file by
choosing File | Save from the menu. Your window should look like
- Select Project | Properties from the menu. Set the Source
and Output directories to the same directory as your project
file (such as yourname\homework).
Note: Setting the source path is not necessary for
compiling and running the program, but it is required to run the
debugger. The debugger won't find your source files if you don't set the
source path. Setting the output path is not strictly necessary
for compiling and running, but if you use the default output path, all
classes are dumped into the same directory, and you get unsightly
warnings about classes with missing source.
- Select Project | Make Project . . . from the menu. Fix any
compiler errors that may occur.
Running a program
Running your program is slightly different depending on whether you run
Running a console application
To run a console application, follow these steps:
- Choose Project | Properties from the menu. Click on the Run/Debug
tab. You will get a dialog like this one:
Uncheck the Close Console Window on exit check box. Click OK.
- Select Run | Run . . . from the menu. Your program will run.
- When your program is finished, type Ctrl+C to return to
Running an applet
To run an applet, follow these steps:
- In the project tree on the left hand side of the project window,
click on the HTML file. Then click on the Source tab on the
bottom of the window. You get a display like this:
- I recommend you simply remove all project notes text and enter the
APPLET tag instead.
If you use the "Project Notes" feature, you can keep your
notes and insert the APPLET tag directly after the BODY
- Select Run | Run . . . from the menu. Your applet will run
inside the applet viewer.
- Close the applet viewer window when you are finished running the
Running a graphical application
To run a graphical application, follow these steps:
- Select Run | Run . . . from the menu. Your graphical
application will run.
- Close the appication window when you are finished.