Return to site

🧰🔍 JDK BIN TOOLS YOU FORGOT YOU HAD (AND THE ONES ADDED/EVOLVED AFTER 2020)

· java,programmmer,techlead

🔸 TL;DR

The JDK ships a seriously underrated toolbox in JAVA_HOME/bin: process discovery (jps), bytecode peeking (javap), heap/thread forensics (jmap/jstack), JMX GUIs (jconsole), plus modern “do-it-all” tooling like jcmd and jfr. Bonus: newer JDKs also brought handy utilities like jwebserver.

Section image

🔸 THE “CLASSIC” DIAGNOSTIC CREW

▪️ jps – list JVM processes (often step #1 to get the PID)

▪️ javap – disassemble .class files (bytecode + signatures): “what did the compiler really generate?”

▪️ jmap – heap histogram / heap dump (.hprof) for memory investigations

▪️ jinfo – JVM flags + system properties for a running process

▪️ jstack – thread dumps: deadlocks, blocked threads, hotspots

▪️ jconsole – built-in JMX UI: threads, memory, GC, MBeans

🔸 THE MODERN MVP: JCMD

If you remember only one: jcmd. It’s the Swiss Army knife that can trigger many diagnostics from a single entry point.

▪️ Examples you’ll actually use:

▪️ jcmd VM.flags → runtime flags

▪️ jcmd VM.system_properties → system props

▪️ jcmd Thread.print → thread dump-style output

▪️ jcmd GC.heap_info → heap overview

▪️ jcmd GC.class_histogram → quick memory signal

🔸“NEW SCHOOL” BIN TOOLS WORTH KNOWING

▪️ jfr – Java Flight Recorder CLI (recordings, summaries, inspection)

▪️ jwebserver – instant static file server for quick demos/tests

▪️ jpackage – build native installers/packages for Java apps

▪️ jdeps – dependency analyzer (great for modularization and classpath sanity)

▪️ jdeprscan – scan jars/classes for deprecated Java SE API usage

▪️ jhsdb – HotSpot/serviceability debugging (deeper JVM forensics)

🔸 TAKEAWAYS

▪️ My go-to triage flow: jps → jcmd → (jstack/jmap) → jfr 🧯

▪️ jcmd reduces tool-hopping: one entry point, many diagnostics 🧰

▪️ jfr is a game-changer when you need real signal with low overhead 📈

▪️ GUI lovers: jconsole is there; VisualVM is a separate install 🖥️

▪️ Modern JDKs quietly got more “ops-friendly” than most devs realize 🚀

#java #jdk #openjdk #jvm #performance #observability #profiling #jfr #debugging #devops #sre #springboot

Go further with Java certification:

Java👇

Spring👇

SpringBook👇