Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Problem in eclipse IDE Galileo  RSS feed

 
kumarjit banerjee
Ranch Hand
Posts: 32
Eclipse IDE Oracle Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am facing a problem in eclipse IDE.




In the above code, The exception is printed at different locations when run successively. The ideal output, which I got from running in command prompt, should be



But when run successively I got the output as above and also different output such as









 
Jesper de Jong
Java Cowboy
Sheriff
Posts: 16006
87
Android IntelliJ IDE Java Scala Spring
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That is because e.printStackTrace(); prints to a different output stream: System.err instead of System.out.

The System.out and System.err streams by default do both write their output to the console, but they are not synchronized with regard to each other. Therefore, the order of messages as they appear on the console via those two streams is not predictable.
 
Rob Spoor
Sheriff
Posts: 21044
85
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Eclipse is notorious for mixing System.out and System.err in unpredictable ways.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!