Java Reference
In-Depth Information
a very simplistic naming/lookup system. Clients must know where to find the
registry with the resources they need.
RMI is very useful for problems of a certain scale, but it is not, in and of
itself, sufficient for high-volume, highly available, mission-critical enterprise
systems. 22 But that is what J2EE and EJB are for. We'll deal with those in
Part V later in the topic.
5.9
T HE J AVA D EBUGGER
How can you stand using the SDK? It doesn't even have a debugger!
Wrong. It has a debugger. It just has an extremely basic command-line
debugger. Example 5.16 shows the output of its help .
Again, we are not going to document everything here. That's what the
online Sun Microsystems Java SDK documentation is for. Instead, we will use
the debugger to step through the execution of our simple application and show
you some of the debugger's basic operations.
There are two ways to invoke jdb . One is to attach it to an already running
JVM that has been started with remote debugging enabled. See the Java SDK
documentation for details on that method. Here we'll show you the simpler
case of invoking the program locally by running the application directly under
the debugger.
The basic invocation is:
$ jdb
You may optionally name the class whose main() is to be executed under
the debugger, but we usually use the run from inside the debugger itself to do
this. Remember that if you want to be able to view local variables in the debug-
ger, you must have compiled your class or classes with the -g option of javac .
In the rest of this section, we will examine an actual debug session. We
will run our single-class application, FetchURL, and use it to retrieve the
index.html file from the Web server on the laptop on which this chapter is
being written. To refresh your memory, remember that the source code for
FetchURL is at Example 3.30. Example 5.17 is what that file looks like.
22. If that sentence did not cause you to get “buzzword bingo,” then you aren't trying.
Search WWH ::




Custom Search