Norm Matloff's Introduction to the Metamata Java IDE

Metamata is a commercial product, but also comes in a free version, called the Personal Edition.

Contents of this Web page:

Where to get Metamata:

Go to the home page.

How to install it:

Download the document install.pdf from the home page, and follow directions there.

Starting it up:

Simply type

metamata

(assuming it is in your path). The Metamata console window will then come up.

Note by the way that the console window includes a "progress bar" at the lower-right corner. When you are compiling, running a program, etc., this will flash to show something is going on.

Project directories:

For the purposes of this introductory document, we will assume that all of your sources files are in a single directory, which we will call a/b/c.

Add a/b/c to your CLASSPATH, as viewed from from the point of view of Metamata, by going to the Metamata console and clicking Preferences then Paths.

Important note: Metamata may get confused if you have a source file (at least one containinng main()) of the same name in different directories in the CLASSPATH.

Starting a session on a project:

Double-click on your project directory in the Metamata console. Your .java source files should appear.

How to use the editor:

You can double-click on a source file name to bring it into the editor. Usage is self-explanatory. The editor is configurable to your taste. If you are editing more than one file, they will be in different buffers of the same editor window, and you must click on Buffers to switch among them.

How to debug a Java program:

If your program has not been compiled under Metamata since the last change to source, do so now. Click on Build in the Metamata console.

In the Metamata console, click on the name of the file which contains main() and then click Run. The debugger window will come up.

There are three subwindows: A source window; a runtime window; and an expression-watch window. The runtime window is further divided into a terminal window on the left, for System.in and System.out, and an error message window on the right. Make sure to pay attention to the latter.

Note that the sizes of the subwindows within the debugger window can be changed. Between each vertically contiguous pair of subwindows is a line marked by tiny up- and down-arrows. Click on such a line and drag it up or down to change the sizes of the windows. You will probably find this to be very important.

In the debug window, click on Process then Options and Arguments, the latter being the program's command-line arguments, if any. Options are those that go to the Java interpreter, and might be to set additional class paths, thread types, etc.

Set breakpoints by clicking on the desired source code line (either in the debug window or the editor window) and then clicking on the flag icon. (I have had trouble with this under the Blackdown JDK, but it works fine under the Sun JDK.) Note that these breakpoints will persist from one Metamata session to another. Note also Metamata's other features, notably the Step to Cursor and Step Out of Method commands.

Start by clicking on Step Into Expression or Step Over Statement, which will actually put you at the first statement in main(). You can then single-step using either Step Into Expression (enter method call) or Step Over Statement (don't enter method call), and as mentioned earlier, move around using Step to Cursor and Step Out of Method. Note that if you hit a breakpoint you may have to click on a Step command twice instead of once. Click on the Go icon (far left, "curved road" under "File") to finish execution of the program.

As with other good debugging tools, you can query the value of a variable by passing the mouse pointer over the variable in question. Unlike some debuggers, Metamata will show you the values of static variables, very nice. Watch Expressions can be set, etc.