JVM CLI

JVM Command-Line Tools

Every JDK ships with a set of diagnostic and management command-line tools that live inside the bin/ directory. Because they travel with the runtime, they are the first tools you should reach for when a Java process misbehaves: they cost nothing, require no agent or instrumentation, and work almost everywhere.

These tools talk to a running JVM through the Java Attach API (the same mechanism the jcmd, jps and jinfo tools use), or operate directly on saved artifacts such as heap dumps and thread dumps. Mastering a handful of them covers most day-to-day diagnosis: finding a process (jps), dumping threads (jstack), sampling the heap (jmap), inspecting flags (jinfo) and triggering diagnostics (jcmd).

Below is every bundled tool worth knowing, with the commands that actually matter.

What you'll find here: See what's running: jps, jcmd -l · Trigger diagnostics & dump threads/heaps: jcmd, jfr · Inspect live statistics: jstat, jinfo · Capture thread and heap artifacts for offline analysis

JVM CLI tools

In-depth guides in this category