aspose file tools*
The moose likes Beginning Java and the fly likes Problem in eclipse IDE Galileo Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Problem in eclipse IDE Galileo" Watch "Problem in eclipse IDE Galileo" New topic
Author

Problem in eclipse IDE Galileo

kumarjit banerjee
Ranch Hand

Joined: Mar 27, 2011
Posts: 32

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

Joined: Aug 16, 2005
Posts: 14269
    
  21

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.


Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 8 API documentation
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19720
    
  20

Eclipse is notorious for mixing System.out and System.err in unpredictable ways.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
 
 
subject: Problem in eclipse IDE Galileo