Using Symantec Café

 

Café provides tools for editing, debugging, and executing Java programs. Café automatically builds makefiles and tracks dependencies so that it can build programs efficiently. Tools are also provided for managing large projects, such as a browser that lets you examine class hierarchies and another that lets you look at the variables and methods of a class. Café allows you to create and save workspaces, which are arrangements of windows that you create for specific tasks. (Workspaces cannot be saved in the lab since we’re operating in a shared environment.)

Creating a Project

Programs developed in Café must be part of a project. A project can contain many Java files and HTML files. When you create a project Café creates a .PRJ file to keep track of the files in the project. It also creates a .MAK file, which is a makefile for the files in your project. When you build (compile and link) your project Cafe uses the makefile to decide which source files need to be recompiled.

To create a project, select New from the Project menu. This opens the Project Express window. In the first screen of the Project Express window, you must pick a name for the project and choose a directory for the project. Use the New Directory button if you need to create a directory for the project. It is a good habit to choose the directory name to be the same as the name of the main class in your project. Click on the Next button to move to the next screen.

On the second screen you must specify whether your project will be an application or an applet. If the project will be an applet you should also specify the name of the HTML file that will invoke your applet.

If you haven’t created your source files yet, click on the Finish button to complete Project creation. You can add your source files to the project when you create and save them. If you have already created your source files, click on the Next button to move to the next screen.

The third screen allows you to add files to the project. Use the directory window to choose your project directory. For each file to be added to the project, highlight the file and use the Add button to add it to the project.

Opening an Existing Project

Choose Open from the Project menu. Select the .PRJ file for the project you want to open. This will open the project. If the project window does not appear, choose Project from the Go To View entry on the Window menu (or press Ctrl-Shift-P) to open the project window. The project window lists all the files in the project. You can double click on any file in this window to open an edit window for the file.

Only one project can be open at a time.

Adding and Removing Files From a Project

Choose Edit from the Project menu to open the Edit Project window. This window allows you to add and remove files from a project. In addition, when you save a file for the first time, or use the Save As command, you have the option of adding the file to the currently open project.

Editing a File

You can open as many edit windows as you wish, including windows for files that are not part of the current project. Use New or Open from the File menu of Café or an existing Edit window, or use the buttons in an existing Edit window. The editor includes the standard cut and paste, and find and replace features.

Building or Compiling a Project

You can compile the file you are currently editing by choosing Compile from the File menu on the Edit window, or by clicking on the Compile File button. To build the project, choose Build from the Project menu or click on the Build button. Café determines which files have changed since you last built the project, compiles only those files, and then links the program.

If there are any errors during compilation, the messages will be written to the output window. If you double click on an error message, the line which caused the error will be highlighted in its edit window.

See Café Help for pictures of these buttons.

You must have a project open to compile or build.

Executing a Program

You can execute a project by choosing Execute Program from the Project menu or by clicking on the Execute Program button. The project will be built if there have been any changes since the last build. Command line arguments can be set by choosing Arguments from the Project menu.

See Café Help for a picture of the Execute Program button.

Café Toolboxes

Café Toolboxes are groups of buttons that you can display. The Build Toolbox has buttons for building and executing a project. The Debug Toolbox has buttons for debugging commands like setting breakpoints and stepping through program code. The Views Toolbox has buttons you can drag into the main work area to display various Café windows, such as the Class Editor window, the Hierarchy Editor window, the Output window, and others. The Workspace Toolbox has a tab for each of your workspaces to allow you to easily switch between them.


Email Me | Office Hours | My Home Page | Department Home | MCC Home Page