• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Tim Cooke
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • paul wheaton
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Tim Holloway
  • Carey Brown
  • salvin francis

Infinite stacktrace message in the command line

 
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)
 
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
 
Sheriff
Posts: 11604
178
Hibernate jQuery Eclipse IDE Spring MySQL Database AngularJS Tomcat Server Chrome Java
  • 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.
 
All of the world's problems can be solved in a garden - Geoff Lawton. Tiny ad:
create, convert, edit or print DOC and DOCX in Java
https://products.aspose.com/words/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!