Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Infinite stacktrace message in the command line

 
Daniel Clinton
Ranch Hand
Posts: 46
5
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello JavaRanch!
Studying for the exam I've been using just notepad (or gedit) with javac
It was uphill work at first (I'd always used an IDE before)
But it has helped my progress ALOT.
Spotting code that won't compile has become easier now. I recommend it.
But there's one thing I can't seem to find a way around in the command prompt
It is to do with seeing the thrown exception message when the stack trace is infinite

This program causes an error due to recursion

The output here is from Eclipse (ECJ compiler)
Using Eclipse the Exception type and message is always shown
followed by a limited set of repeated stacktrace messages.
Is it possible by limiting the maximum text output,
or otherwise, to make the Exception type/message visible in the Command Line with javac?

The prompt I'm using is cmd.exe on Windows 7 (or a terminal with Ubuntu)
 
Joanne Neal
Rancher
Posts: 3742
16
  • Likes 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
On Windows you can increase the size of the command prompt buffer which will allow you to scroll back up to the start of the stack trace.
Click on the icon in the top left of the command prompt window and select properties from the menu.
Click on the Layout tab
Then alter the height value of the Screen Buffer Size. The maximum value is 9999 so that should be enough to handle most stack traces. If not you'll just have to hit Ctrl-C to stop the output before the buffer is full.
 
Daniel Clinton
Ranch Hand
Posts: 46
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Great stuff Joanne!
Problem solved
Thanks for your help
 
Roel De Nijs
Sheriff
Posts: 10662
144
AngularJS Chrome Eclipse IDE Hibernate Java jQuery MySQL Database Spring Tomcat Server
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Daniel Clinton wrote:Studying for the exam I've been using just notepad (or gedit) with javac
It was uphill work at first (I'd always used an IDE before)
But it has helped my progress ALOT.
Spotting code that won't compile has become easier now. I recommend it.

Extremely pleased to read your experience using notepad/gedit with javac. It's exactly the experience you can expect when switching from IDE to just a text editor and javac. A little harder at first, but once you are up to speed, so much more benefit than using an IDE. Hopefully people who are not completely convinced about this approach, change their mind after reading your post.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic