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
Register / Login


JavaRanch » Java Forums » Java » Beginning Java
Reply 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
Bartender

Joined: Aug 16, 2005
Posts: 12950
    
    3

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 7 API documentation
Scala Notes - My blog about Scala
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19232

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


SCJP 1.4 - SCJP 6 - SCWCD 5
How To Ask Questions How To Answer Questions
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: Problem in eclipse IDE Galileo
 
Similar Threads
Float f = 5;?
How to run Hello World example in Eclipse with Glassfish v3 as appserver
Is this a bug in Eclipse's compiler?
NPE in Eclipse, but not in commandline?
Exception in thread "main" java.lang.NoClassDefFoundError: Test