When your application has some problem, the first thing to check is running processes on the machine.
For Linux OS we generally use ps -ef. ps is one of the most used Linux troubleshooting commands. The JDK provides similar functionality for Java processes through jps. The jps command-line utility provides a list of all running Java processes on a machine for which the user has access rights. The access rights are determined by access-control mechanisms specific to the operating system.
-
Debugging Java on the Command Line
Some bugs are hard to replicate on your personal computer but easily replicated on production or test machines. It is a common situation that professional Java developers deal with frequently. To debug such problems, OpenJDK provides two tools, remote debugging and jdb.
This article focuses on jdb.
For Java applications, typical production and test machines are Linux servers without display managers, so that only command line tools are available. Here we cannot use professional IDEs like IntelliJ IDEA, Eclipse, or Apache NetBeans IDE.
In such scenarios, we can use jdb. jdb is a command line debugger and it is part of the OpenJDK.