Java Reference
In-Depth Information
The
threads
command numbers all the threads, which enables you to use the
suspend
command followed by that number to pause the thread, as in
suspend 1
. You can resume
a thread by using the
resume
command followed by its number.
Another convenient way to set a breakpoint in a Java program is to use the
catch
text
command, which pauses execution when the
Exception
class named by
text
is caught.
You can also cause an exception to be ignored by using the
ignore
text
command with
the
Exception
class named by
text
.
B
One obscure feature of the kit is that the command-line option
-D
can modify the perfor-
mance of the Java class library.
If you have used other programming languages prior to learning Java, you might be
familiar with environment variables, which provide information about the operating sys-
tem in which a program is running. An example is the
Classpath
setting, which indi-
cates the folders in which the Java interpreter should look for a class file.
Because different operating systems have different names for their environment vari-
ables, they cannot be read directly by a Java program. Instead, Java includes a number of
different system properties that are available on any platform with a Java implementa-
tion.
Some properties are used only to get information. The following system properties are
among those that should be available on any Java implementation:
java.version
—The version number of the Java interpreter
n
java.vendor
—A string identifying the vendor associated with the Java interpreter
n
os.name
—The operating system in use
n
os.version
—The version number of that operating system
n
Other properties can affect how the Java class library performs when being used inside a
Java program. An example of this is the
java.io.tmpdir
property, which defines the
folder that Java's input and output classes use as a temporary workspace.
A property can be set at the command line by using the
-D
option followed by the prop-
erty name, an equals sign (“=”), and the new value of the property, as in this command:
java -Duser.timezone=Asia/Jakarta Auctioneer