How To: Java Stack Trace in Linux
A simple tip for newbies - how to get Java stack trace, the invaluable tool to debug java programs, in Linux:
- Type the Ctrl key followed by \, in short Ctrl \.
I just used it to debug a persistent problem where a server process which automatically fetches data from a third-party site was inexplicably hanging.
All of us who used Ctrl-Break on windows for a stack trace, like myself will find this non-intuitive. It took me some time and googling to figure this out, so I decided to (document) blog it once and for all.
Filed under Headline News, How To, Java Software, Linux, Linux Migration, Open Source Software, Programming, Tech Note |
|
RSS 2.0 |
Trackback this Article
|
Email this Article
You may also like to read |





































February 24th, 2008 at 3:50 am
hi there,
I use jps and jstack utilities in the JDK (java 1.5 and above from sun) to do the above trick.
If the java process is a daemon then, the jstack technique will work whereas you won’t be able to do the CTRL + \ trick.
just my 2 cents.
BR,
~A
February 24th, 2008 at 4:35 am
Thanks for sharing.
Take care,
Angsuman
September 5th, 2008 at 9:22 am
Hi Angsuman,
I am trying to run my Jar or Linux SUSE 10, when I run it, it just gives me the following error, no trace.
How can I get the full trace. Please help.
dsadm@mach1:/opt/IBM/media/SAP/sapjco> java -jar ditest1.jar
The java class is not found: com/sap/mw/jco/JCO$Exception
dsadm@mach1:/opt/IBM/media/SAP/sapjco>
September 5th, 2008 at 8:05 pm
You just need to set the classpath properly. Does you jar contain all the required class files?