HP (Hewlett-Packard) 5992-1918 TV Antenna User Manual


 
environment variable may be useful to add options to the command line when the application
is run. This environment variable is primarily intended to support the initialization of tools,
specifically the launching of native or Java agents using the -agentlib or -javaagent options.
The JAVA_TOOL_OPTIONS environment variable is processed at the time of the invocation of
the Java VM. When this environment variable is set, the JNI_CreateJavaVM() function
prepends the value of the environment variable to the options supplied in its JavaVMInitArgs
argument. For security reasons this option is disabled in setuid processes; that is, processes where
the effective user or group ID differs from the real user or group ID.
In the following example, the environment variable is set to launch the hprof profiler when the
application is started:
export JAVA_TOOL_OPTIONS=-agentlib:hprof
Although this environment variable is intended to support the initialization of tools, it is also
useful for augmenting the command line with options for diagnostics purposes. For example,
you could use it to add the -XX:OnError option to the command line when it would be helpful
for a script or command to be executed when a fatal error occurred.
Since this environment variable is processed when JNI_CreateJavaVM() is called, it cannot
be used to augment the Java launcher options. Some examples of these launcher options are the
following VM selection options:
java -d64
java -client
java -server
To pass arguments to the Java launcher, set the JAVA_LAUNCHER_OPTIONS environment variable
to a string containing the desired arguments.
This environment variable is fully described in the JVMTI specification at:
http://java.sun.com/j2se/1.5.0/docs/guide/jvmti/jvmti.html#tooloptions
1.13 jconsole (1.5+ only)
The jconsole command launches a graphical console tool that enables you to monitor and
manage Java applications on a local or remote machine.
jconsole can attach to any application that is started with the Java Management Extensions
(JMX) agent. A system property defined on the command line enables the JMX agent. Once
attached, jconsole can be used to display useful information such as thread usage, memory
consumption, and details about class loading, runtime compilation, and the operating system.
In addition to monitoring, jconsole can be used to dynamically change several parameters in
the running system. For example, the setting of the -verbose:gc option can be changed so that
garbage collection trace output can be dynamically enabled or disabled for a running application.
To use jconsole:
1. Start the application with the -Dcom.sun.management.jmxremote option. This option
sets the com.sun.management.jmxremote system property, which enables the JMX
agent.
2. Start jconsole with the jconsole command.
3. When jconsole starts, it shows a window listing the managed Java VMs on the machine.
The process id (pid) and command line arguments for each Java VM are displayed. Select
one of the Java VMs, and jconsole attaches to it.
Following is an example invocation of jconsole. First the Java application must be started with
the JMX agent enabled:
$ java -Dcom.sun.management.jmxremote -jar Java2Demo.jar &
[1] 13028
Now the jconsole tool can be started on the managed Java VM:
38 Diagnostic and Monitoring Tools and Options