If you work with Java you will meet a handful of command line tools that do the heavy lifting while your IDE takes credit. This quick guide covers the tools that actually matter for running code building jars, generating docs and debugging memory and threads. Read this and you will stop blaming the build server for five minutes at least.
Start here when something is failing and you have no idea why. These are the first things to check before summoning the senior developer with a coffee mug that says I broke production.
Runs compiled classes on a chosen Java runtime. Always check the runtime version before blaming a dependency mismatch or the build pipeline.
java -version
The compiler that turns .java into .class. If javac complains check your classpath and module path rather than yelling at your editor.
javac MyApp.java
A REPL for Java. Great for poking APIs or testing a one liner without creating an entire project and several existential questions.
jshell
Ship code that other humans can use and packages that actually run. These tools keep your releases from being a mystery wrapped in a zip file.
Generate API docs from Java source comments. Good documentation saves teammates from guessing and future you from regret.
javadoc MyApp.java
Bundle classes and resources into archives. If your runnable jar does not find the main class check the manifest and stop guessing.
jar cfm app.jar Manifest.txt -C classes .
Create a custom runtime image that contains only the modules you need. This is the practical way to avoid bloated containers and surprise storage bills.
jlink --module-path mods --add-modules my.app --output my-image
When the app behaves like it drank three espressos these tools help you find memory leaks deadlocks and GC drama without resorting to ritual sacrifice.
Inspect the heap for memory analysis. Useful when memory consumption looks like a toddler who found a candy jar.
jmap -heap <PID>
Dump thread stacks to diagnose deadlocks stalls and livelocks. Paste the output into an issue and watch the investigative work begin.
jstack <PID>
Monitor JVM stats over time to track garbage collector behavior. Live metrics beat guesswork and prayer for performance tuning.
jstat -gc <PID> 1000
Analyze static dependencies to clean up accidental libraries and plan module migration. Great for projects that acquired dependencies like souvenir magnets.
jdeps -summary my.jar
These three things save hours and prevent blame from being assigned to the nearest build tool. Use the right CLI tool for the task and you will look competent even on days when you are not.
I know how you can get Azure Certified, Google Cloud Certified and AWS Certified. It's a cool certification exam simulator site called certificationexams.pro. Check it out, and tell them Cameron sent ya!
This is a dedicated watch page for a single video.