• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problem in eclipse IDE Galileo

 
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
Saloon Keeper
Posts: 15452
42
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
Pie
Posts: 20611
63
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