jcmd(1)
okay so bestie π, welcome to the jcmd(1) page β it lives under Troubleshooting Tools, and the whole vibe is sending diagnostic command requests to a running Java Virtual Machine (JVM). Itβs giving βI know whatβs happening inside your JVMβ energy, and honestly? iconic. β¨
πΈ NAME πΈ
jcmd β sends diagnostic command requests to a running Java Virtual Machine (JVM). No cap. π«Ά
β¨ SYNOPSIS β¨
jcmd [-l|-h|-help]
jcmd pid|main-class PerfCounter.print
jcmd pid|main-class -f filename
jcmd pid|main-class command[ arguments]
π¦ DESCRIPTION π¦
The jcmd utility is used to send diagnostic command requests to the JVM. It must be used on the same machine on which the JVM is running, and have the same effective user and group identifiers that were used to launch the JVM. π«‘
π Note: to invoke diagnostic commands from a remote machine or with different identifiers, you can use thecom.sun.management.DiagnosticCommandMBeaninterface. For more information about theDiagnosticCommandMBeaninterface, see the API documentation athttp://docs.oracle.com/javase/8/docs/jre/api/management/extension/com/sun/management/DiagnosticCommandMBean.html
If you run jcmd without arguments or with the -l option, it prints the list of running Java process identifiers with the main class and command-line arguments that were used to launch the process. Running jcmd with the -h or -help option prints the toolβs help message. π
If you specify the processes identifier (pid) or the main class (main-class) as the first argument, jcmd sends the diagnostic command request to the Java process with the specified identifier or to all Java processes with the specified name of the main class. You can also send the diagnostic command request to all available Java processes by specifying 0 as the process identifier. Use one of the following as the diagnostic command request:
Perfcounter.printβ prints the performance counters available for the specified Java process. The list of performance counters might vary with the Java process. β-f filenameβ the name of the file from which to read diagnostic commands and send them to the specified Java process. Used only with the-foption. Each command in the file must be written on a single line. Lines starting with a number sign (#) are ignored. Processing of the file ends when all lines have been read or when a line containing thestopkeyword is read. πcommand [arguments]β the command to be sent to the specified Java process. The list of available diagnostic commands for a given process can be obtained by sending thehelpcommand to this process. Each diagnostic command has its own set of arguments. To see the description, syntax, and a list of available arguments for a command, use the name of the command as the argument for thehelpcommand. π₯
β οΈ Note: if any arguments contain spaces, you must surround them with single or double quotation marks ('or"). In addition, you must escape single or double quotation marks with a backslash (\) to prevent the operating system shell from processing quotation marks. Alternatively, you can surround these arguments with single quotation marks and then with double quotation marks (or with double quotation marks and then with single quotation marks). π
π OPTIONS π
Options are mutually exclusive. periodt. π
-f filenameβ reads commands from the specified file. This option can be used only if you specify the process identifier or the main class as the first argument. Each command in the file must be written on a single line. Lines starting with a number sign (#) are ignored. Processing of the file ends when all lines have been read or when a line containing thestopkeyword is read.-h,-helpβ prints a help message.-lβ prints the list of running Java processes identifiers with the main class and command-line arguments.
π SEE ALSO π
Thatβs the whole page, bestie π«Ά β source/version JDK 8, dated 03 March 2015, and yes itβs the jcmd(1) manual. Periodt. π
π¦ where this page comes from
- centos-stream 9: java-11-openjdk-devel-fastdebug 1:11.0.20.1.1-2.el9 Β· ASL 1.1 and ASL 2.0 and BSD and BSD with advertising and GPL+ and GPLv2 and GPLv2 with exceptions and IJG and LGPLv2+ and MIT and MPLv2.0 and Public Domain and W3C and zlib and ISC and FTL and RSA
- Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms