• Post Reply Bookmark Topic Watch Topic
  • New Topic

Throwable methods  RSS feed

 
Paul Keohan
Ranch Hand
Posts: 411
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is getStackTrace() only a method of jdk1.4? If I want to see the complete details of an exception, but cannot do printStackTrace() what can I do? I can't do printStackTrace() because I don't have a DOS window with this particular application. getPrintStackTrace() would be ideal but I can't compile when I add it to my code and I'm using jdk1.3.
Paul
 
Philip Shanks
Ranch Hand
Posts: 189
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yep, new as of 1.4 (or so it says in the API docs).
See if this (or some variant) works for you:

tested in a 1.4.1 environment, "error.txt" contained:
java.io.FileNotFoundException: imaginary.abc (The system cannot find the file specified)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(FileInputStream.java:103)
at demo.StackTraceMsg.main(StackTraceMsg.java:20)
Should work in 1.3.x just as well.
[ April 18, 2003: Message edited by: Philip Shanks ]
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!