Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in Java by (10.2k points)
I am thinking of creating a debug tool for my Java application.

I am wondering if it is possible to get a stack trace, just like Exception.printStackTrace() but without actually throwing an exception?

My goal is to, in any given method, dump a stack to see who the method caller is.

1 Answer

0 votes
by (46k points)
You can also try Thread.getAllStackTraces() to get a map of stack traces for all the threads that are alive.​​​​​​

Related questions

0 votes
1 answer
+2 votes
3 answers
0 votes
1 answer
0 votes
1 answer

Browse Categories

...